pub struct LiveTest<'a, C> { /* private fields */ }Expand description
A live component under test, made by TestApp::live. It keeps the
component’s signed snapshot between calls, as the page does, and sends the
fields set with set on every call.
Implementations§
Source§impl<C: LiveComponent> LiveTest<'_, C>
impl<C: LiveComponent> LiveTest<'_, C>
Sourcepub fn set(&mut self, name: &str, value: impl ToString) -> &mut Self
pub fn set(&mut self, name: &str, value: impl ToString) -> &mut Self
Sets a form field, like typing in an input bound to the component. It is sent with every call from now on.
Sourcepub async fn call(&mut self, action: &str) -> TestResponse
pub async fn call(&mut self, action: &str) -> TestResponse
Calls an action without arguments.
Sourcepub async fn call_with(&mut self, action: &str, args: Value) -> TestResponse
pub async fn call_with(&mut self, action: &str, args: Value) -> TestResponse
Calls an action with its arguments (a JSON array). When the answer is a 200, the component’s new snapshot is kept for the next call.
Auto Trait Implementations§
impl<'a, C> !RefUnwindSafe for LiveTest<'a, C>
impl<'a, C> !UnwindSafe for LiveTest<'a, C>
impl<'a, C> Freeze for LiveTest<'a, C>
impl<'a, C> Send for LiveTest<'a, C>
impl<'a, C> Sync for LiveTest<'a, C>
impl<'a, C> Unpin for LiveTest<'a, C>
impl<'a, C> UnsafeUnpin for LiveTest<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more