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.
CellEdit
One cell editing its field in place: a form posting the field alone to the record’s edit route.
ChartData
One chart, as its data table reads.
ChartSeries
One series of a ChartData.
CreateOptionLink
A creatable choice’s link: the select it creates a record for, and the create page it opens.
DetailEntry
One entry of a detail page.
DisabledAction
A custom action whose button shows disabled, as the record’s state refuses it.
EmptyTable
Why a table rendered no rows, and the links it offers out of that state.
FakeAccount
An account at a FakeProvider: what the ID token it issues says.
FakeProvider
An OpenID Connect provider serving its discovery document and token endpoint on a loopback port, which a panel’s OidcProvider reaches as it would a real one.
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.
ImpersonationBanner
The banner over a page a user reads while acting as another.
ImportError
One value an import refused.
LanguageChoice
One locale the shell’s language menu offers.
NavGroup
One labelled group of the sidebar: its label and the href of each entry it lists.
PageFilterBar
A page’s filter bar.
PickerColumn
One toggleable column the column picker offers.
RecordNavLink
One tab of a record’s navigation.
RecordTableData
One record table, as its markup reads.
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.
Section
One Section block.
StatTile
One stat tile.
Submission
A form post being built: the pairs it sends, keyed by the form’s field enum K.
SummaryFigure
One summary under a list’s rows.
Tab
One tab of a Tabs block.
TabLink
One tab of a list’s tab bar.
TestClient
Sends requests carrying cookies and tenant.
WizardStep
One step of a Wizard block.

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.
Picked
What the page a create framed by a creatable choice’s dialog lands on offers.

Constants§

TEST_DATABASE_URL
The variable naming the database test_db connects to.

Functions§

action_badge
The count a header action’s button shows as its badge, posting to url. None when no button posts there or it shows no badge.
action_label
The text of the button posting to url, its icon aside. None when no button posts there.
action_tooltip
The hint the button posting to url shows on hover. None when no button posts there or it shows none.
area_back_link
The href of an area’s link back to the panel, or None outside every area.
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.
charts
The charts html renders, in document order.
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.
create_option_links
Each creatable choice’s link on the page.
declined_message
The message a record fn declined the save with, which the form renders above its fields in an element carrying data-declined.
detail_entries
The entries a detail page renders, in document order, a nested block’s in its place.
dirty_form
Whether a form renders dirty, so leaving the page asks first: a refused save keeps what the user typed, and the server marks its form with data-form-dirty.
disabled_actions
The custom actions html shows disabled, in document order: a row’s, or a record page header’s.
empty_table
The zero-rows message of html, or None when the table renders rows.
external_sign_out
Where a panel behind external auth sends a user out to: the page it refuses them on, and the page its Sign out answers with, link the app’s sign-out from a data-external-sign-out element.
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.
impersonate_buttons
The user_ids the auth::impersonate_button forms of html act as, in document order.
impersonation_banner
The banner html shows, or None while the signed-in user acts as themselves.
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.
inline_scripts
The text of each script the page carries inline, in document order.
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.
input_values
Reads every value the named <input>s post when the form submits untouched, in document order, skipping a radio or checkbox left unchecked: each row a file list keeps posts one.
language_choices
The locales the shell’s language menu offers, in the order the panel lists them; empty when the page shows no menu.
migrated_db
A Db over models whose tables migrations made, holding no rows: what the app’s migrations add beside the models, such as a foreign key or a check constraint written by hand, holds in the test too, where test_db pushes the models’ schema alone.
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.
nav_groups
The sidebar’s groups, in the order it lists them.
nav_links
The href of each sidebar entry that links somewhere, in the order the sidebar lists them.
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_filter_bar
The filter bar html renders, or None without one.
page_language
The language the page reads in, as its <html lang> names it.
page_title
The page’s heading, as its [data-page-title] holds it; None when it has none.
picked
What the landing page of a framed create offers, or None on any other page.
posts_picking
Whether the page’s guarded form posts back in pick mode, so a refused save of a create framed by a creatable choice’s dialog stays in the dialog.
provider_buttons
The provider buttons a login or sign-up page shows, as each provider’s key and the link that starts its sign-in, in order.
record_navigation
The tabs of the navigation a record’s page renders, in document order: each tab’s data-record-nav, and whether aria-current marks it. Empty without a navigation.
record_tables
The record tables html renders, in document order.
recovery_codes
The recovery codes the page shows, once, after a set-up or a regeneration; empty when it shows none.
refreshes_to
The URL a <meta http-equiv="refresh"> moves the page on to.
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.
robots
The search engine instructions the page’s robots tag names, None when it has no such tag.
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.
sections
The sections html renders, in document order: a nested section’s after the one holding it, whose keys hold the nested section’s too.
selects_matching
Whether the bulk bar offers to select every record the list’s query selects, beyond its page.
session_cookie_value
The value of the session cookie a response set, on whichever panel, if any.
set_cookie_header
The full Set-Cookie header for name, so tests can assert attributes.
sortable_columns
The names of the columns whose header sorts the table, in order: those the header marks with aria-sort.
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.
stats
The stat tiles html renders, in document order.
summaries
The summaries of every list html renders, in document order.
tab_links
The tabs of every list html renders, in document order.
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.
tenant_page_link
The href of the tenant menu’s link to the page page names, profile for the tenant settings or registration for a new tenant; None when the menu has no such link.
test_db
A Db holding the tables of models and no rows.
trail
The topbar’s trail: each step’s text, with its href unless it is the page itself.
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.
widgets
The names of the widgets a page’s grid renders, in order: RecentOrdersWidget is recent-orders.
wizard_steps
The steps of every Wizard block html renders, in document order.

Type Aliases§

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