Skip to content

Commit

Permalink
Merge pull request #14 from deinsoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
equiman authored Apr 18, 2023
2 parents 576db73 + bd264d5 commit 5c374c3
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"itue",
"matc",
"paypal",
"qlsq",
"qrc",
"qrcc",
"qrh",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Fixed for any bug fixes.
Security to invite users to upgrade in case of vulnerabilities.
-->

## 0.0.3 - 2023/04/18

### Added

- LabelText queries snippets

## 0.2.0 - 2023/04/18

### Added
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ All the `░variantBy` cursor start with `getBy` by default, but can be easily c

#### 1. Role

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

#### 2. LabelText

| Trigger | Result |
| :------- | ------------------------------------------------------------------------------- |
| `ql→` | `screen.░variantByLabelText(░)█` |
| `qlf→` | `screen.░variantByLabelText('░Text Match')█` |
| `qls→` | `screen.░variantByLabelText('░ext Matc', {exact: false})█` |
| `qlq→` | `screen.░variantByLabelText('░Text Match', {selector: '░query'})█` |
| `qlsq→` | `screen.░variantByLabelText('░ext matc', {exact: false, selector: '░query'})█` |

#### 4. Text

| Trigger | Result |
| :------- | ------------------------------------------------------------------- |
| Trigger | Result |
| :------- | --------------------------------------------------------------------- |
| `qt→` | `screen.░variantByText(░)█` |
| `qtf→` | `screen.░variantByText('░Text Match')█` |
| `qti→` | `screen.░variantByText('░text match', {ignore: false})█` |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "testing-library-snippets",
"description": "VS Code Testing Library snippets for JS and TS",
"version": "0.2.0",
"version": "0.3.0",
"displayName": "Testing Library Snippets",
"publisher": "deinsoftware",
"icon": "images/light-icon.png",
Expand Down
36 changes: 36 additions & 0 deletions snippets/queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,42 @@
"description": "Role heading level"
},

"query.label": {
"prefix": "ql",
"body": [
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText(${2})$0"
],
"description": "LabelText query with options"
},
"query.label.full": {
"prefix": "qlf",
"body": [
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:Text Match}')$0"
],
"description": "LabelText query with options"
},
"query.label.substring": {
"prefix": "qls",
"body": [
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:ext Matc}', {exact: false})$0"
],
"description": "LabelText query substring match"
},
"query.label.query": {
"prefix": "qlq",
"body": [
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:Text Match}', {selector: '${3:query}'})$0"
],
"description": "LabelText query with a specific query selector"
},
"query.label.substring+query": {
"prefix": "qlsq",
"body": [
"screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}LabelText('${2:ext Matc}', {exact: false, selector: '${3:query}'})$0"
],
"description": "LabelText query substring match with a specific query selector"
},

"query.text": {
"prefix": "qt",
"body": [
Expand Down

0 comments on commit 5c374c3

Please sign in to comment.