Skip to content

Commit 5c374c3

Browse files
authored
Merge pull request #14 from deinsoftware/dev
Dev
2 parents 576db73 + bd264d5 commit 5c374c3

File tree

5 files changed

+58
-5
lines changed

5 files changed

+58
-5
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"itue",
99
"matc",
1010
"paypal",
11+
"qlsq",
1112
"qrc",
1213
"qrcc",
1314
"qrh",

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.3 - 2023/04/18
13+
14+
### Added
15+
16+
- LabelText queries snippets
17+
1218
## 0.2.0 - 2023/04/18
1319

1420
### Added

README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ All the `░variantBy` cursor start with `getBy` by default, but can be easily c
144144

145145
#### 1. Role
146146

147-
| Trigger | Result |
148-
| :------- | ------------------------------------------------------------------------------------------------- |
147+
| Trigger | Result |
148+
| :------- | --------------------------------------------------------------------------------------------------- |
149149
| `qr→` | `screen.░variantByRole('░id')█` |
150150
| `qro→` | `screen.░variantByRole('░id', {░})█` |
151151
| `qron→` | `screen.░variantByRole('░id', {name: ░})█` |
@@ -154,10 +154,20 @@ All the `░variantBy` cursor start with `getBy` by default, but can be easily c
154154
| `qrh→` | `screen.░variantByRole('heading')█` |
155155
| `qrhl→` | <code>screen.░variantByRole('heading', { level: ░<1&#124;2&#124;3&#124;4&#124;5&#124;6>} )█</code> |
156156

157+
#### 2. LabelText
158+
159+
| Trigger | Result |
160+
| :------- | ------------------------------------------------------------------------------- |
161+
| `ql→` | `screen.░variantByLabelText(░)█` |
162+
| `qlf→` | `screen.░variantByLabelText('░Text Match')█` |
163+
| `qls→` | `screen.░variantByLabelText('░ext Matc', {exact: false})█` |
164+
| `qlq→` | `screen.░variantByLabelText('░Text Match', {selector: '░query'})█` |
165+
| `qlsq→` | `screen.░variantByLabelText('░ext matc', {exact: false, selector: '░query'})█` |
166+
157167
#### 4. Text
158168

159-
| Trigger | Result |
160-
| :------- | ------------------------------------------------------------------- |
169+
| Trigger | Result |
170+
| :------- | --------------------------------------------------------------------- |
161171
| `qt→` | `screen.░variantByText(░)█` |
162172
| `qtf→` | `screen.░variantByText('░Text Match')█` |
163173
| `qti→` | `screen.░variantByText('░text match', {ignore: false})█` |

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.2.0",
4+
"version": "0.3.0",
55
"displayName": "Testing Library Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",

snippets/queries.json

+36
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,42 @@
4949
"description": "Role heading level"
5050
},
5151

52+
"query.label": {
53+
"prefix": "ql",
54+
"body": [
55+
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText(${2})$0"
56+
],
57+
"description": "LabelText query with options"
58+
},
59+
"query.label.full": {
60+
"prefix": "qlf",
61+
"body": [
62+
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:Text Match}')$0"
63+
],
64+
"description": "LabelText query with options"
65+
},
66+
"query.label.substring": {
67+
"prefix": "qls",
68+
"body": [
69+
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:ext Matc}', {exact: false})$0"
70+
],
71+
"description": "LabelText query substring match"
72+
},
73+
"query.label.query": {
74+
"prefix": "qlq",
75+
"body": [
76+
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:Text Match}', {selector: '${3:query}'})$0"
77+
],
78+
"description": "LabelText query with a specific query selector"
79+
},
80+
"query.label.substring+query": {
81+
"prefix": "qlsq",
82+
"body": [
83+
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:ext Matc}', {exact: false, selector: '${3:query}'})$0"
84+
],
85+
"description": "LabelText query substring match with a specific query selector"
86+
},
87+
5288
"query.text": {
5389
"prefix": "qt",
5490
"body": [

0 commit comments

Comments
 (0)