@@ -31,7 +31,9 @@ const getInvalidAssertion = (
31
31
) =>
32
32
allQueryUseInAssertion ( query ) . map ( ( query ) => ( {
33
33
code : `expect(${ query } ('Hello'))${ matcher } ` ,
34
- errors : [ { messageId } ] ,
34
+ // TODO: column can't be checked as queries are generated with and without `screen` prefix
35
+ // so this must be generated in a different way to be able to check error column.
36
+ errors : [ { messageId, line : 1 } ] ,
35
37
} ) ) ;
36
38
37
39
ruleTester . run ( RULE_NAME , rule , {
@@ -152,8 +154,9 @@ ruleTester.run(RULE_NAME, rule, {
152
154
[ ]
153
155
) ,
154
156
{
157
+ // TODO: improve this case to get error on `queryAllByText` rather than `screen`
155
158
code : 'expect(screen.getAllByText("button")[1]).not.toBeInTheDocument()' ,
156
- errors : [ { messageId : 'absenceQuery' } ] ,
159
+ errors : [ { messageId : 'absenceQuery' , line : 1 , column : 15 } ] ,
157
160
} ,
158
161
...queryByQueries . reduce (
159
162
( validRules , queryName ) => [
@@ -186,8 +189,10 @@ ruleTester.run(RULE_NAME, rule, {
186
189
[ ]
187
190
) ,
188
191
{
192
+ // TODO: improve this case to get error on `queryAllByText` rather than `screen`
189
193
code : 'expect(screen.queryAllByText("button")[1]).toBeInTheDocument()' ,
190
- errors : [ { messageId : 'presenceQuery' } ] ,
194
+ errors : [ { messageId : 'presenceQuery' , line : 1 , column : 15 } ] ,
191
195
} ,
196
+ // TODO: add more tests for custom queries
192
197
] ,
193
198
} ) ;
0 commit comments