Skip to main content

Crate tablo_test

Crate tablo_test 

Source
Expand description

Drives a built Router without a socket, carrying cookies, CSRF token, and tenant, and reads values back out of its responses.

Structs§

Bell
The bell a panel page renders in its topbar.
BellNotification
One notification the bell’s sheet lists.
EmptyTable
Why a table rendered no rows, and the links it offers out of that state.
FilterOption
One <option> of a filter select, or one checkbox of a filter checklist.
Group
One group of a grouped table: its header’s label and the rows under it on this page.
IgnoredFilter
A requested filter the table did not apply.
ImportError
One value an import refused.
PickerColumn
One toggleable column the column picker offers.
Reply
A response with its body read, keyed by the form’s field enum K for the queries over its form.
ResourceClient
Requests to R in the panel TestClient::panel names, built by TestClient::resource.
Row
One data row of a rendered table.
RowActions
The action targets of one row.
SearchGroup
One resource’s results.
SearchResult
One record a global search lists.
Submission
A form post being built: the pairs it sends, keyed by the form’s field enum K.
Tab
One tab of a Tabs block.
TestClient
Sends requests carrying cookies and tenant.

Enums§

EmptyReason
What emptied a table, as its zero-rows message’s data-empty names it.
ErrorKind
Why a field renders an error, as its error slot’s data-error names it.
IgnoredReason
Why a table ignored a requested filter, as the banner’s data-ignored names it.
ImportRefusal
Why an import refused a whole file, as its alert’s data-import-refusal names it.

Constants§

SESSION_COOKIE
Names the session cookie Topcoat’s default token store writes.
TEST_DATABASE_URL
The variable naming the database test_db connects to.

Functions§

authenticator_code
The code an authenticator app holding secret shows now.
authenticator_code_at
The six-digit code an authenticator app holding the base32 secret shows at unix_secs.
bell
The bell html renders, or None when the page shows none.
body_bytes
Collect a response body as bytes.
body_string
Collect a response body as a lossy UTF-8 string.
column_picker
The toggleable columns the column picker offers, in order, or None when the table renders no picker.
columns
The names of the columns the table’s header shows, in order, without the bulk and actions columns.
confirms_first
Whether the button posting to action asks first: a confirming trigger is a plain button that opens the dialog, a direct write is a submit button. None when no button posts there.
cookie_header
One Cookie header value from (name, value) pairs, or None when empty.
empty_table
The zero-rows message of html, or None when the table renders rows.
field_error
Why the field posting name was refused, or None when it renders no error.
field_error_message
The sentence rendered under the field posting name, or None when it renders no error.
filter_options
The options of the select or checklist filter name, or None when name names neither. A checklist offering no option reads as an empty list, since its control still renders.
find_href_with
The first href in html that contains needle, its entities decoded.
form_body
URL-encode (key, value) pairs into an urlencoded form body.
groups
The groups of html in document order, empty when the table renders ungrouped. A group holds the rows from its header to the next one.
ignored_filters
The filters the banner of html lists as ignored, in its order; empty without a banner.
import_columns
The form keys the import page of html lists as the columns a file may name, in order.
import_errors
The values the import page of html lists as refused, in its order; empty when it lists none.
import_refusal
Why the import page of html refused the whole file, or None when it did not.
input_value
Reads the value the named <input>s post when the form submits untouched, in either attribute order or quote style: the last one’s value, skipping a radio or checkbox left unchecked. A toggle reads true or its hidden false, and a radio choice its checked option, or the hidden blank before them when none is checked.
mount
panel mounted on a router holding db, beside the app’s own discovered pages and routes: the router an app builds, without its asset bundle.
mount_with_handle
mount’s router and the mounted panel’s handle, which TestClient::panel resolves TestClient::resource’s URLs in.
multipart_body
Builds a multipart body, one part per entry: None is a text part, Some("") the browser’s “no file chosen” part, Some(name) a chosen file.
nav_badge
The badge text of the sidebar entry linking to href, or None when that entry shows no badge or no entry links there.
notification
The flash notification a response set for the next page, decoded.
now
Seconds since the Unix epoch.
page_direction
The direction the page’s text runs in, ltr or rtl, as its <html dir> names it.
page_language
The language the page reads in, as its <html lang> names it.
recovery_codes
The recovery codes the page shows, once, after a set-up or a regeneration; empty when it shows none.
refusal
The declaration mistakes a panel refused to mount with, for a test to match on their kind.
response_cookies
The (name, value) pairs a response’s Set-Cookie headers carry.
rich_text_values
The HTML of each rich text value html renders, in document order.
row_actions
The action targets of the row whose checkbox value or action URL carries key, or None when no row matches.
row_keys
The record key of every row in document order, read from its bulk checkbox: a row with no checkbox has none to read.
rows
The data rows of html in document order, excluding group headers.
search_box
Where the topbar’s search box submits its term, or None when the page shows no box.
search_results
The results html lists, by resource in document order: the results page’s, or the topbar box’s.
session_cookie_value
The session cookie value a response set, if any.
set_cookie_header
The full Set-Cookie header for name, so tests can assert attributes.
stale_form
Whether the edit form refuses the save because another save changed the record since the form opened: it renders an element carrying data-stale.
tabs
The tabs of every Tabs block html renders, in document order: a nested block’s after the tab holding it, whose keys hold the nested block’s too.
test_db
A Db holding the tables of models and no rows.
two_factor_secret
The authenticator key a set-up shows, in base32, or None when the page shows no set-up.
two_factor_state
Which view of the settings page renders: off, setup or on, as its form’s data-two-factor names it; None when the page shows recovery codes instead.

Type Aliases§

FieldOf
The field enum of R’s record form, e.g. PostFormField.