|
1 | 1 | {
|
2 |
| - "getBy.role": { |
3 |
| - "prefix": "gbr", |
4 |
| - "body": ["screen.getByRole('${1:id}')$0"], |
5 |
| - "description": "getByRole query" |
6 |
| - }, |
7 |
| - "getBy.role.options": { |
8 |
| - "prefix": "gbro", |
9 |
| - "body": ["screen.getByRole('${1:id}', {$2})$0"], |
10 |
| - "description": "getByRole query with options" |
| 2 | + "by.role": { |
| 3 | + "prefix": "br", |
| 4 | + "body": [ |
| 5 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}')$0" |
| 6 | + ], |
| 7 | + "description": "Role query" |
11 | 8 | },
|
12 |
| - "getBy.role.checkbox": { |
13 |
| - "prefix": "gbrc", |
14 |
| - "body": ["screen.getByRole('checkbox')$0"], |
15 |
| - "description": "getByRole checkbox" |
| 9 | + "by.role.options": { |
| 10 | + "prefix": "bro", |
| 11 | + "body": [ |
| 12 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}', {$3})$0" |
| 13 | + ], |
| 14 | + "description": "Role query with options" |
16 | 15 | },
|
17 |
| - "getBy.role.checkbox.checked": { |
18 |
| - "prefix": "gbrcc", |
19 |
| - "body": ["screen.getByRole('checkbox', { checked: ${1|true,false|} })$0"], |
20 |
| - "description": "getByRole checkbox checked" |
| 16 | + "by.role.options.name": { |
| 17 | + "prefix": "bron", |
| 18 | + "body": [ |
| 19 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('${2:id}',\t{$3})$0" |
| 20 | + ], |
| 21 | + "description": "Role query with name on options" |
21 | 22 | },
|
22 |
| - "getBy.role.heading": { |
23 |
| - "prefix": "gbrh", |
24 |
| - "body": ["screen.getByRole('heading')$0"], |
25 |
| - "description": "getByRole heading" |
| 23 | + "by.role.checkbox": { |
| 24 | + "prefix": "brc", |
| 25 | + "body": [ |
| 26 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('checkbox')$0" |
| 27 | + ], |
| 28 | + "description": "Role checkbox" |
26 | 29 | },
|
27 |
| - "getBy.role.heading.level": { |
28 |
| - "prefix": "gbrhl", |
29 |
| - "body": ["screen.getByRole('heading', { level: ${1|1,2,3,4,5,6|} })$0"], |
30 |
| - "description": "getByRole heading level" |
| 30 | + "by.role.checkbox.checked": { |
| 31 | + "prefix": "brcc", |
| 32 | + "body": [ |
| 33 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('checkbox', { checked: ${2|true,false|} })$0" |
| 34 | + ], |
| 35 | + "description": "Role checkbox checked" |
31 | 36 | },
|
32 |
| - "getAllBy.role": { |
33 |
| - "prefix": "gabr", |
34 |
| - "body": ["screen.getAllByRole('${1:id}')$0"], |
35 |
| - "description": "getAllByRole query" |
| 37 | + "by.role.heading": { |
| 38 | + "prefix": "brh", |
| 39 | + "body": [ |
| 40 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('heading')$0" |
| 41 | + ], |
| 42 | + "description": "Role heading" |
36 | 43 | },
|
37 |
| - "getAllBy.role.options": { |
38 |
| - "prefix": "gabro", |
39 |
| - "body": ["screen.getAllByRole('${1:id}', {$2})$0"], |
40 |
| - "description": "getAllByRole query with options" |
| 44 | + "by.role.heading.level": { |
| 45 | + "prefix": "brhl", |
| 46 | + "body": [ |
| 47 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Role('heading', { level: ${2|1,2,3,4,5,6|} })$0" |
| 48 | + ], |
| 49 | + "description": "Role heading level" |
41 | 50 | },
|
42 | 51 |
|
43 |
| - "getBy.text": { |
44 |
| - "prefix": "gbt", |
45 |
| - "body": ["screen.getByText($1)$0"], |
46 |
| - "description": "getByText query" |
| 52 | + "by.text": { |
| 53 | + "prefix": "bt", |
| 54 | + "body": [ |
| 55 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text($2)$0" |
| 56 | + ], |
| 57 | + "description": "Text query" |
47 | 58 | },
|
48 |
| - "getBy.text.full": { |
49 |
| - "prefix": "gbtf", |
50 |
| - "body": ["screen.getByText('${1:Text Match}')$0"], |
51 |
| - "description": "getByText query full string match" |
| 59 | + "by.text.full": { |
| 60 | + "prefix": "btf", |
| 61 | + "body": [ |
| 62 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:Text Match}')$0" |
| 63 | + ], |
| 64 | + "description": "Text query full string match" |
52 | 65 | },
|
53 |
| - "getBy.text.ignore": { |
54 |
| - "prefix": "gbti", |
55 |
| - "body": ["screen.getByText('${1:text match}', {ignore: false})$0"], |
56 |
| - "description": "getByText query full string ignore case" |
| 66 | + "by.text.ignore": { |
| 67 | + "prefix": "bti", |
| 68 | + "body": [ |
| 69 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:text match}', {ignore: false})$0" |
| 70 | + ], |
| 71 | + "description": "Text query full string ignore case" |
57 | 72 | },
|
58 |
| - "getBy.text.substring": { |
59 |
| - "prefix": "gbts", |
60 |
| - "body": ["screen.getByText('${1:ext Matc}', {exact: false})$0"], |
61 |
| - "description": "getByText query substring match" |
| 73 | + "by.text.substring": { |
| 74 | + "prefix": "bts", |
| 75 | + "body": [ |
| 76 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:ext Matc}', {exact: false})$0" |
| 77 | + ], |
| 78 | + "description": "Text query substring match" |
62 | 79 | },
|
63 |
| - "getBy.text.substring+ignore": { |
64 |
| - "prefix": "gbtsi", |
| 80 | + "by.text.substring+ignore": { |
| 81 | + "prefix": "btsi", |
65 | 82 | "body": [
|
66 |
| - "screen.getByText('${1:ext matc}', {exact: false, ignore: false})$0" |
| 83 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text('${2:ext matc}', {exact: false, ignore: false})$0" |
67 | 84 | ],
|
68 |
| - "description": "getByText query substring match ignore case" |
| 85 | + "description": "Text query substring match ignore case" |
69 | 86 | },
|
70 |
| - "getBy.text.startWith": { |
71 |
| - "prefix": "gbtsw", |
| 87 | + "by.text.startWith": { |
| 88 | + "prefix": "btsw", |
72 | 89 | "body": [
|
73 |
| - "screen.getByText((content) => content.startsWith('${1:Text}'))$0" |
| 90 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content) => content.startsWith('${2:Text}'))$0" |
74 | 91 | ],
|
75 |
| - "description": "getByText query start with match" |
| 92 | + "description": "Text query start with match" |
76 | 93 | },
|
77 |
| - "getBy.text.element.startWith": { |
78 |
| - "prefix": "gbtesw", |
| 94 | + "by.text.element.startWith": { |
| 95 | + "prefix": "btesw", |
79 | 96 | "body": [
|
80 |
| - "screen.getByText((content, element) => {", |
81 |
| - "\treturn element.tagName.toLowerCase() === '${1:div}' && content.startsWith('${2:Text}')", |
| 97 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content, element) => {", |
| 98 | + "\treturn element.tagName.toLowerCase() === '${2:div}' && content.startsWith('${3:Text}')", |
82 | 99 | "})"
|
83 | 100 | ],
|
84 |
| - "description": "getByText query start with match on specific element" |
| 101 | + "description": "Text query start with match on specific element" |
85 | 102 | },
|
86 |
| - "getBy.text.endWith": { |
87 |
| - "prefix": "gbtew", |
88 |
| - "body": ["screen.getByText((content) => content.endsWith('${1:Match}'))$0"], |
89 |
| - "description": "getByText query end with match" |
| 103 | + "by.text.endWith": { |
| 104 | + "prefix": "btew", |
| 105 | + "body": [ |
| 106 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content) => content.endsWith('${2:Match}'))$0" |
| 107 | + ], |
| 108 | + "description": "Text query end with match" |
90 | 109 | },
|
91 |
| - "getBy.text.element.endWith": { |
92 |
| - "prefix": "gbteew", |
| 110 | + "by.text.element.endWith": { |
| 111 | + "prefix": "bteew", |
93 | 112 | "body": [
|
94 |
| - "screen.getByText((content, element) => {", |
95 |
| - "\treturn element.tagName.toLowerCase() === '${1:div}' && content.endsWith('${1:Match}')", |
| 113 | + "screen.${1|getBy,getAllBy,queryBy,queryAllBy,findBy,findByAll|}Text((content, element) => {", |
| 114 | + "\treturn element.tagName.toLowerCase() === '${2:div}' && content.endsWith('${3:Match}')", |
96 | 115 | "})"
|
97 | 116 | ],
|
98 |
| - "description": "getByText query end with match on specific element" |
| 117 | + "description": "Text query end with match on specific element" |
99 | 118 | }
|
100 | 119 | }
|
0 commit comments