Skip to content

Commit b01a3a1

Browse files
committed
fix query variant documentation
1 parent 08a0340 commit b01a3a1

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Fixed for any bug fixes.
99
Security to invite users to upgrade in case of vulnerabilities.
1010
-->
1111

12+
## 0.0.9 - 2023/04/18
13+
14+
### Changed
15+
16+
- Query variant documentation
17+
1218
## 0.0.8 - 2023/04/18
1319

1420
### Changed

README.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Open the extension manager with <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>X</kbd> (W
7272

7373
## Cheat Sheet
7474

75-
You can write any combination of Search variants and Search types.
75+
You can write any combination of **Search variants** and **Search types**.
7676

7777
### Search variants
7878

@@ -128,31 +128,33 @@ Below is a list of all available snippets and the triggers of each one. The `░
128128

129129
### Queries
130130

131+
All the query `░variant` start with `░getBy` by default, but can be easily changed between `<getBy|getAllBy|queryBy|queryAllBy|findBy|findByAll>` once reach the TAB position.
132+
131133
#### 1. Role
132134

133135
| Trigger | Result |
134136
| :------- | ----------------------------------------------------------------- |
135-
| `br→` | `screen.░getByRole('░id')█` |
136-
| `bro→` | `screen.░getByRole('░id', {░})█` |
137-
| `bron→` | `screen.░getByRole('░id', {name: ░})█` |
138-
| `brc→` | `screen.░getByRole('checkbox')█` |
139-
| `brcc→` | `screen.░getByRole('checkbox', { checked: ░<true\|false>} })█` |
140-
| `brh→` | `screen.░getByRole('heading')█` |
141-
| `brhl→` | `screen.░getByRole('heading', { level: ░<1\|2\|3\|4\|5\|6>} })█` |
137+
| `br→` | `screen.░variantRole('░id')█` |
138+
| `bro→` | `screen.░variantRole('░id', {░})█` |
139+
| `bron→` | `screen.░variantRole('░id', {name: ░})█` |
140+
| `brc→` | `screen.░variantRole('checkbox')█` |
141+
| `brcc→` | `screen.░variantRole('checkbox', { checked: ░<true\|false>} })█` |
142+
| `brh→` | `screen.░variantRole('heading')█` |
143+
| `brhl→` | `screen.░variantRole('heading', { level: ░<1\|2\|3\|4\|5\|6>} })█` |
142144

143145
#### 4. Text
144146

145147
| Trigger | Result |
146148
| :------- | ----------------------------------------------------------------- |
147-
| `bt→` | `screen.░getByText(░)█` |
148-
| `btf→` | `screen.░getByText('░Text Match')█` |
149-
| `bti→` | `screen.░getByText('░text match', {ignore: false})█` |
150-
| `bts→` | `screen.░getByText('░ext Matc', {exact: false})█` |
151-
| `btsi→` | `screen.░getByText('░ext matc', {exact: false, ignore: false})█` |
152-
| `btsw→` | `screen.░getByText((content) => content.startsWith('░Text'))█` |
153-
| `btesw→` | <code>screen.░getByText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.startsWith('░Text')<br/>})█</code> |
154-
| `btew→` | `screen.░getByText((content) => content.endsWith('░Match'))█` |
155-
| `bteew→` | <code>screen.░getByText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.endsWith('░Match')<br/>})█</code> |
149+
| `bt→` | `screen.░variantText(░)█` |
150+
| `btf→` | `screen.░variantText('░Text Match')█` |
151+
| `bti→` | `screen.░variantText('░text match', {ignore: false})█` |
152+
| `bts→` | `screen.░variantText('░ext Matc', {exact: false})█` |
153+
| `btsi→` | `screen.░variantText('░ext matc', {exact: false, ignore: false})█` |
154+
| `btsw→` | `screen.░variantText((content) => content.startsWith('░Text'))█` |
155+
| `btesw→` | <code>screen.░variantText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.startsWith('░Text')<br/>})█</code> |
156+
| `btew→` | `screen.░variantText((content) => content.endsWith('░Match'))█` |
157+
| `bteew→` | <code>screen.░variantText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.endsWith('░Match')<br/>})█</code> |
156158

157159
### Debug
158160

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "testing-library-snippets",
33
"description": "VS Code Testing Library snippets for JS and TS",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"displayName": "Testing Library Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",

0 commit comments

Comments
 (0)