Skip to content

Commit 7ffe467

Browse files
authored
Merge pull request #11 from deinsoftware/dev
rename al queries with variants
2 parents 93d4f57 + 5d9cfb3 commit 7ffe467

File tree

4 files changed

+82
-76
lines changed

4 files changed

+82
-76
lines changed

.vscode/settings.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"cSpell.words": [
33
"beus",
4-
"brc",
5-
"brcc",
6-
"brh",
7-
"brhl",
8-
"bro",
9-
"bron",
10-
"bteew",
11-
"btesw",
12-
"btew",
13-
"btf",
14-
"bti",
15-
"bts",
16-
"btsi",
17-
"btsw",
4+
"qrc",
5+
"qrcc",
6+
"qrh",
7+
"qrhl",
8+
"qro",
9+
"qron",
10+
"qteew",
11+
"qtesw",
12+
"qtew",
13+
"qtf",
14+
"qti",
15+
"qts",
16+
"qtsi",
17+
"qtsw",
1818
"deinsoftware",
1919
"Equiman",
2020
"ithub",

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
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.1.0 - 2023/04/18
13+
14+
### Changed
15+
16+
- rename all the query snippets
17+
1218
## 0.0.10 - 2023/04/18
1319

1420
### Changed

README.md

Lines changed: 30 additions & 30 deletions
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 queries with any combination of **Search variants** and **Search types**.
7676

7777
### Search variants
7878

@@ -113,48 +113,48 @@ Below is a list of all available snippets and the triggers of each one. The `░
113113
### Import
114114

115115
| Trigger | Result |
116-
| -------: | ------------------------------------------------------------------- |
117-
| `itl→` | `import { render, screen } from '@testing-library/░<react\|vue>'█` |
118-
| `itr→` | `import { render, screen } from '@testing-library/react'█` |
119-
| `itv→` | `import { render, screen } from '@testing-library/vue'█` |
120-
| `itrh→` | `import { renderHook } from '@testing-library/react'█` |
121-
| `itue→` | `import user from '@testing-library/user-event'█` |
116+
| :------- | ------------------------------------------------------------------- |
117+
| `itl→` | `import { render, screen } from '@testing-library/░<react\|vue>'█` |
118+
| `itr→` | `import { render, screen } from '@testing-library/react'█` |
119+
| `itv→` | `import { render, screen } from '@testing-library/vue'█` |
120+
| `itrh→` | `import { renderHook } from '@testing-library/react'█` |
121+
| `itue→` | `import user from '@testing-library/user-event'█` |
122122

123123
### User Event
124124

125125
| Trigger | Result |
126-
| -------: | ---------------------------------------------------------------------- |
127-
| `beus→` | <code>beforeEach(() => {<br/>&nbsp;&nbsp;user.setup()<br/>})█</code> |
126+
| :------- | ---------------------------------------------------------------------- |
127+
| `beus→` | <code>beforeEach(() => {<br/>&nbsp;&nbsp;user.setup()<br/>})█</code> |
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.
131+
All the `░variantBy` cursor start with `getBy` by default, but can be easily changed between `<getBy|getAllBy|queryBy|queryAllBy|findBy|findByAll>` using arrow keys once reach the TAB position.
132132

133133
#### 1. Role
134134

135-
| Trigger | Result |
136-
| :------- | ------------------------------------------------------------------- |
137-
| `br` | `screen.░variantRole('░id')█` |
138-
| `bro` | `screen.░variantRole('░id', {░})█` |
139-
| `bron` | `screen.░variantRole('░id', {name: ░})█` |
140-
| `brc` | `screen.░variantRole('checkbox')█` |
141-
| `brcc` | <code>screen.░variantRole('checkbox', { checked: ░<true&#124;false>} )█</code> |
142-
| `brh` | `screen.░variantRole('heading')█` |
143-
| `brhl` | <code>screen.░variantRole('heading', { level: ░<1&#124;2&#124;3&#124;4&#124;5&#124;6>} )█</code> |
135+
| Trigger | Result |
136+
| :------- | ------------------------------------------------------------------------------------------------- |
137+
| `qr` | `screen.░variantByRole('░id')█` |
138+
| `qro` | `screen.░variantByRole('░id', {░})█` |
139+
| `qron` | `screen.░variantByRole('░id', {name: ░})█` |
140+
| `qrc` | `screen.░variantByRole('checkbox')█` |
141+
| `qrcc` | <code>screen.░variantByRole('checkbox', { checked: ░<true&#124;false>} )█</code> |
142+
| `qrh` | `screen.░variantByRole('heading')█` |
143+
| `qrhl` | <code>screen.░variantByRole('heading', { level: ░<1&#124;2&#124;3&#124;4&#124;5&#124;6>} )█</code> |
144144

145145
#### 4. Text
146146

147-
| Trigger | Result |
148-
| :------- | ----------------------------------------------------------------- |
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> |
147+
| Trigger | Result |
148+
| :------- | ------------------------------------------------------------------- |
149+
| `qt` | `screen.░variantByText(░)█` |
150+
| `qtf` | `screen.░variantByText('░Text Match')█` |
151+
| `qti` | `screen.░variantByText('░text match', {ignore: false})█` |
152+
| `qts` | `screen.░variantByText('░ext Matc', {exact: false})█` |
153+
| `qtsi` | `screen.░variantByText('░ext matc', {exact: false, ignore: false})█` |
154+
| `qtsw` | `screen.░variantByText((content) => content.startsWith('░Text'))█` |
155+
| `qtesw` | <code>screen.░variantByText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.startsWith('░Text')<br/>})█</code> |
156+
| `qtew` | `screen.░variantByText((content) => content.endsWith('░Match'))█` |
157+
| `qteew` | <code>screen.░variantByText((content, element) => {<br/>&nbsp;&nbsp;const tag = element.tagName.toLowerCase() === '░div'<br/>&nbsp;&nbsp;return tag && content.endsWith('░Match')<br/>})█</code> |
158158

159159
### Debug
160160

snippets/queries.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
11
{
2-
"by.role": {
3-
"prefix": "br",
2+
"query.role": {
3+
"prefix": "qr",
44
"body": [
55
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}')$0"
66
],
77
"description": "Role query"
88
},
9-
"by.role.options": {
10-
"prefix": "bro",
9+
"query.role.options": {
10+
"prefix": "qro",
1111
"body": [
1212
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}', {$3})$0"
1313
],
1414
"description": "Role query with options"
1515
},
16-
"by.role.options.name": {
17-
"prefix": "bron",
16+
"query.role.options.name": {
17+
"prefix": "qron",
1818
"body": [
1919
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}',\t{$3})$0"
2020
],
2121
"description": "Role query with name on options"
2222
},
23-
"by.role.checkbox": {
24-
"prefix": "brc",
23+
"query.role.checkbox": {
24+
"prefix": "qrc",
2525
"body": [
2626
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('checkbox')$0"
2727
],
2828
"description": "Role checkbox"
2929
},
30-
"by.role.checkbox.checked": {
31-
"prefix": "brcc",
30+
"query.role.checkbox.checked": {
31+
"prefix": "qrcc",
3232
"body": [
3333
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('checkbox', { checked: ${2|true,false|} })$0"
3434
],
3535
"description": "Role checkbox checked"
3636
},
37-
"by.role.heading": {
38-
"prefix": "brh",
37+
"query.role.heading": {
38+
"prefix": "qrh",
3939
"body": [
4040
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('heading')$0"
4141
],
4242
"description": "Role heading"
4343
},
44-
"by.role.heading.level": {
45-
"prefix": "brhl",
44+
"query.role.heading.level": {
45+
"prefix": "qrhl",
4646
"body": [
4747
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('heading', { level: ${2|1,2,3,4,5,6|} })$0"
4848
],
4949
"description": "Role heading level"
5050
},
5151

52-
"by.text": {
53-
"prefix": "bt",
52+
"query.text": {
53+
"prefix": "qt",
5454
"body": [
5555
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text($2)$0"
5656
],
5757
"description": "Text query"
5858
},
59-
"by.text.full": {
60-
"prefix": "btf",
59+
"query.text.full": {
60+
"prefix": "qtf",
6161
"body": [
6262
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:Text Match}')$0"
6363
],
6464
"description": "Text query full string match"
6565
},
66-
"by.text.ignore": {
67-
"prefix": "bti",
66+
"query.text.ignore": {
67+
"prefix": "qti",
6868
"body": [
6969
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:text match}', {ignore: false})$0"
7070
],
7171
"description": "Text query full string ignore case"
7272
},
73-
"by.text.substring": {
74-
"prefix": "bts",
73+
"query.text.substring": {
74+
"prefix": "qts",
7575
"body": [
7676
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:ext Matc}', {exact: false})$0"
7777
],
7878
"description": "Text query substring match"
7979
},
80-
"by.text.substring+ignore": {
81-
"prefix": "btsi",
80+
"query.text.substring+ignore": {
81+
"prefix": "qtsi",
8282
"body": [
8383
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:ext matc}', {exact: false, ignore: false})$0"
8484
],
8585
"description": "Text query substring match ignore case"
8686
},
87-
"by.text.startWith": {
88-
"prefix": "btsw",
87+
"query.text.startWith": {
88+
"prefix": "qtsw",
8989
"body": [
9090
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content) => content.startsWith('${2:Text}'))$0"
9191
],
9292
"description": "Text query start with match"
9393
},
94-
"by.text.element.startWith": {
95-
"prefix": "btesw",
94+
"query.text.element.startWith": {
95+
"prefix": "qtesw",
9696
"body": [
9797
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content, element) => {",
9898
"\tconst tag = element.tagName.toLowerCase() === '${2:div}'",
@@ -101,15 +101,15 @@
101101
],
102102
"description": "Text query start with match on specific element"
103103
},
104-
"by.text.endWith": {
105-
"prefix": "btew",
104+
"query.text.endWith": {
105+
"prefix": "qtew",
106106
"body": [
107107
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content) => content.endsWith('${2:Match}'))$0"
108108
],
109109
"description": "Text query end with match"
110110
},
111-
"by.text.element.endWith": {
112-
"prefix": "bteew",
111+
"query.text.element.endWith": {
112+
"prefix": "qteew",
113113
"body": [
114114
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content, element) => {",
115115
"\tconst tag = element.tagName.toLowerCase() === '${2:div}'",

0 commit comments

Comments
 (0)