You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/JestMatchers.md
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ import TOCInline from '@theme/TOCInline';
7
7
8
8
<TOCInlinetoc={toc} />
9
9
10
-
# Element Existence
10
+
##Element Existence
11
11
12
-
## `toBeOnTheScreen()`
12
+
###`toBeOnTheScreen()`
13
13
14
14
```ts
15
15
expect(element).toBeOnTheScreen()
@@ -21,9 +21,9 @@ This allows you to assert whether element is in the element tree or not.
21
21
This matchers requires element to be attached to the element tree. This might be useful if your holding a reference to an element and the element gets unmounted during the test.
@@ -33,23 +33,23 @@ This allows you to assert whether the given element has a text content or not. I
33
33
34
34
When `text` parameter is `undefined` it will only check for existence of text content, and when `text` is defined it will check if the actual text content matches passed value.
This allows you to assert whether the given `TextInput` element has specified display value. It accepts either `string` or `RegExp` matchers, as well as `TextMatchOptions`.
43
43
44
-
## `toHaveAccessibleValue()`
44
+
###`toHaveAccessibleValue()`
45
45
46
46
```ts
47
47
expect(element).toHaveAccessibleValue(...)
48
48
```
49
49
50
50
This allows you to assert whether the given element has specified accessible value.
51
51
52
-
## `toBeEnabled()` / `toBeDisabled`
52
+
###`toBeEnabled()` / `toBeDisabled`
53
53
54
54
```ts
55
55
expect(element).toBeEnabled()
@@ -63,7 +63,7 @@ This matchers are direct negation of each other, and both are probivided to avoi
63
63
:::
64
64
65
65
66
-
## `toBeSelected()`
66
+
###`toBeSelected()`
67
67
68
68
```ts
69
69
expect(element).toBeSelected()
@@ -72,7 +72,7 @@ expect(element).toBeSelected()
72
72
This allows you to assert whether the given element is selected from user's perspective. It relies on accessibility selected state as set by `aria-selected` or `accessibilityState.selected` props.
73
73
74
74
75
-
## `toBeChecked()` / `toBePartiallyChecked()`
75
+
###`toBeChecked()` / `toBePartiallyChecked()`
76
76
77
77
```ts
78
78
expect(element).toBeChecked()
@@ -86,7 +86,7 @@ These allows you to assert whether the given element is checked or partially che
86
86
*`toBePartiallyChecked()` matchers works only on elements with `checkbox` role.
87
87
:::
88
88
89
-
## `toBeExpanded()` / `toBeCollapsed()`
89
+
###`toBeExpanded()` / `toBeCollapsed()`
90
90
91
91
```ts
92
92
expect(element).toBeExpanded()
@@ -100,17 +100,17 @@ This matchers are direct negation of each other for expandable elements (element
100
100
:::
101
101
102
102
103
-
## `toBeBusy()`
103
+
###`toBeBusy()`
104
104
105
105
```ts
106
106
expect(element).toBeBusy()
107
107
```
108
108
109
109
This allows you to assert whether the given element is busy from user's perspective. It relies on accessibility selected state as set by `aria-busy` or `accessibilityState.busy` props.
110
110
111
-
# Element Styles
111
+
##Element Styles
112
112
113
-
## `toBeVisible()`
113
+
###`toBeVisible()`
114
114
115
115
```ts
116
116
expect(element).toBeVisible()
@@ -120,7 +120,7 @@ This allows you to assert whether the given element is visible from user's persp
120
120
121
121
The element is considered invisibile when it or any of its ancestors has `display: none` or `opacity: 0` styles, as well as when it's hidden from accessbility.
0 commit comments