LithoAssertions
which provides entry points to all Litho AssertJ helpers.@Deprecated
public final class ComponentAssert
extends <any>
Component
s.
To create an instance of this class, invoke
or assertThat(ComponentContext, Component)
.assertThat(Component.Builder)
Modifier and Type | Method and Description |
---|---|
LithoViewAssert |
afterStateUpdate()
Deprecated.
|
static ComponentAssert |
assertThat(Component.Builder<?> builder)
Deprecated.
|
static ComponentAssert |
assertThat(ComponentContext componentContext,
Component component)
Deprecated.
|
ComponentAssert |
containsOnlySubComponents(SubComponent... subComponents)
Deprecated.
Use
LithoViewAssert#hasExactly(int, Class) instead. |
ComponentAssert |
containsSubComponent(SubComponent subComponent)
Deprecated.
|
ComponentAssert |
doesNotContainSubComponent(SubComponent subComponent)
Deprecated.
|
ComponentAssert |
doesNotHaveVisibleDrawable(Drawable drawable)
Deprecated.
Use
LithoViewAssert.doesNotHaveVisibleDrawable(Drawable) instead. |
ComponentAssert |
doesNotHaveVisibleText(int resourceId)
Deprecated.
Use
LithoViewAssert.doesNotHaveVisibleText(int) instead. |
ComponentAssert |
doesNotHaveVisibleText(java.lang.String text)
Deprecated.
Use
LithoViewAssert.doesNotHaveVisibleText(String) instead. |
ComponentAssert |
doesNotHaveVisibleTextContaining(java.lang.String text)
Deprecated.
|
ComponentAssert |
doesNotHaveVisibleTextMatching(java.lang.String pattern)
Deprecated.
|
<A> <any> |
extracting(<any> extractor)
Deprecated.
Extract values from the underlying component based on the
Extractor provided. |
ComponentAssert |
extractingSubComponentAt(int index)
Deprecated.
|
<any> |
extractingSubComponents(ComponentContext c)
Deprecated.
Use
LithoViewAssert#hasExactly(int, Class) instead. |
<any> |
extractingSubComponentsDeeply(ComponentContext c)
Deprecated.
Use
LithoViewAssert#hasExactly(int, Class) instead. |
ComponentAssert |
hasContentDescription(java.lang.String contentDescription)
Deprecated.
Use
LithoViewAssert.hasContentDescription(String) instead. |
ComponentAssert |
hasNoSubComponents()
Deprecated.
|
<T1,T2> ComponentAssert |
hasProps(<any> property,
T1 value)
Deprecated.
Assert that a given
Component has a property equaling the provided value. |
<T1,T2> ComponentAssert |
hasPropsMatching(<any> property,
<any> matcher)
Deprecated.
Assert that a given
Component has a property matching the provided matcher. |
ComponentAssert |
hasSubComponents(SubComponent... subComponents)
Deprecated.
Use
LithoViewAssert#containsComponents(Class) instead. |
ComponentAssert |
hasViewTag(int tagId,
java.lang.Object tagValue)
Deprecated.
Use
LithoViewAssert.hasViewTag(int, Object) instead. |
ComponentAssert |
hasVisibleDrawable(Drawable drawable)
Deprecated.
Use
LithoViewAssert.hasVisibleDrawable(Drawable) instead. |
ComponentAssert |
hasVisibleDrawable(int drawableRes)
Deprecated.
Use
LithoViewAssert.hasVisibleDrawable(int) instead. |
ComponentAssert |
hasVisibleText(int resourceId)
Deprecated.
Use
LithoViewAssert.hasVisibleText(int) instead. |
ComponentAssert |
hasVisibleText(java.lang.String text)
Deprecated.
Use
LithoViewAssert.hasVisibleText(String) instead. |
ComponentAssert |
hasVisibleTextContaining(java.lang.String text)
Deprecated.
Use
LithoViewAssert.hasVisibleTextContaining(String) instead. |
ComponentAssert |
hasVisibleTextMatching(java.lang.String pattern)
Deprecated.
Use
LithoViewAssert.hasVisibleTextMatching(String) instead. |
ComponentAssert |
willNotRender()
Deprecated.
see
wontRender() |
ComponentAssert |
willRender()
Deprecated.
Use
LithoViewAssert.willRenderContent() that will check if the root
component won't return null or a child with height and width equal to 0 |
LithoViewAssert |
withStateUpdate(StateUpdatesTestHelper.StateUpdater updater)
Deprecated.
|
ComponentAssert |
wontRender()
Deprecated.
Use
LithoViewAssert.willNotRenderContent() ()} that will check if the root
component will return null or a child with width oir height equal to 0 |
public static ComponentAssert assertThat(ComponentContext componentContext, Component component)
public static ComponentAssert assertThat(Component.Builder<?> builder)
@Deprecated public LithoViewAssert afterStateUpdate()
For more details see withStateUpdate(StateUpdatesTestHelper.StateUpdater)
@Deprecated public LithoViewAssert withStateUpdate(StateUpdatesTestHelper.StateUpdater updater)
As an alternative, try invoking the code that causes the real state update in your test.
For example, if your component updates the state to hide a piece of text once clicked,
instead of calling that same test update, use InteractionUtil
to fake a click on the component, which will cause
the state update (and other effects that could be tested perhaps)
If you are unable to solve your problem that way, use this method as a last resort. This would be similar to cases when one resorts to reflection to make a test work. Ugly, but needed in rare cases.
@Deprecated public ComponentAssert hasNoSubComponents()
extractingSubComponents(com.facebook.litho.ComponentContext)
instead.@Deprecated public ComponentAssert containsSubComponent(SubComponent subComponent)
extractingSubComponents(com.facebook.litho.ComponentContext)
instead.@Deprecated public ComponentAssert doesNotContainSubComponent(SubComponent subComponent)
extractingSubComponents(com.facebook.litho.ComponentContext)
instead.@Deprecated public ComponentAssert hasContentDescription(java.lang.String contentDescription)
LithoViewAssert.hasContentDescription(String)
instead.@Deprecated public ComponentAssert hasVisibleDrawable(int drawableRes)
LithoViewAssert.hasVisibleDrawable(int)
instead.@Deprecated public ComponentAssert hasVisibleDrawable(Drawable drawable)
LithoViewAssert.hasVisibleDrawable(Drawable)
instead.@Deprecated public ComponentAssert doesNotHaveVisibleDrawable(Drawable drawable)
LithoViewAssert.doesNotHaveVisibleDrawable(Drawable)
instead.hasVisibleDrawable(Drawable)
@Deprecated public ComponentAssert hasVisibleText(java.lang.String text)
LithoViewAssert.hasVisibleText(String)
instead.@Deprecated public ComponentAssert hasVisibleText(int resourceId)
LithoViewAssert.hasVisibleText(int)
instead.@Deprecated public ComponentAssert doesNotHaveVisibleText(java.lang.String text)
LithoViewAssert.doesNotHaveVisibleText(String)
instead.hasVisibleText(String)
.@Deprecated public ComponentAssert doesNotHaveVisibleText(int resourceId)
LithoViewAssert.doesNotHaveVisibleText(int)
instead.hasVisibleText(int)
.@Deprecated public ComponentAssert hasVisibleTextMatching(java.lang.String pattern)
LithoViewAssert.hasVisibleTextMatching(String)
instead.@Deprecated public ComponentAssert doesNotHaveVisibleTextMatching(java.lang.String pattern)
LithoViewAssert.doesNotHaveVisibleTextMatching(String)
instead.hasVisibleTextMatching(String)
.@Deprecated public ComponentAssert hasVisibleTextContaining(java.lang.String text)
LithoViewAssert.hasVisibleTextContaining(String)
instead.@Deprecated public ComponentAssert doesNotHaveVisibleTextContaining(java.lang.String text)
LithoViewAssert.doesNotHaveVisibleTextContaining(String)
instead.hasVisibleTextContaining(String)
.@Deprecated public ComponentAssert hasViewTag(int tagId, java.lang.Object tagValue)
LithoViewAssert.hasViewTag(int, Object)
instead.tagId
- Index of the view tag.tagValue
- View tag value.@Deprecated public ComponentAssert hasSubComponents(SubComponent... subComponents)
LithoViewAssert#containsComponents(Class)
instead.@Deprecated public ComponentAssert containsOnlySubComponents(SubComponent... subComponents)
LithoViewAssert#hasExactly(int, Class)
instead.public <A> <any> extracting(<any> extractor)
Extractor
provided.A
- Type of the value extracted.extractor
- The extractor applied to the Component.@Deprecated public <any> extractingSubComponents(ComponentContext c)
LithoViewAssert#hasExactly(int, Class)
instead.@Deprecated public <any> extractingSubComponentsDeeply(ComponentContext c)
LithoViewAssert#hasExactly(int, Class)
instead.public ComponentAssert extractingSubComponentAt(int index)
@Deprecated public ComponentAssert wontRender()
LithoViewAssert.willNotRenderContent()
()} that will check if the root
component will return null or a child with width oir height equal to 0Component
renders to null, i.e. its onCreateLayout
returns null.@Deprecated public ComponentAssert willRender()
LithoViewAssert.willRenderContent()
that will check if the root
component won't return null or a child with height and width equal to 0Component
produces a non-null layout.public <T1,T2> ComponentAssert hasProps(<any> property, T1 value)
Component
has a property equaling the provided value.public <T1,T2> ComponentAssert hasPropsMatching(<any> property, <any> matcher)
Component
has a property matching the provided matcher.@Deprecated public ComponentAssert willNotRender()
wontRender()