@@ -2,99 +2,99 @@ import {setupBrowser} from '../src';
22
33describe ( 'queries' , ( ) => {
44 it ( 'queryBy resolves with matching element' , async ( ) => {
5- const { queryByText} = await setupBrowser ( browser )
5+ const { queryByText} = setupBrowser ( browser )
66
77 const button = await queryByText ( 'Unique Button Text' )
88 expect ( await button ?. getText ( ) ) . toEqual ( 'Unique Button Text' )
99 } )
1010
1111 it ( 'queryBy resolves with null when there are no matching elements' , async ( ) => {
12- const { queryByText} = await setupBrowser ( browser )
12+ const { queryByText} = setupBrowser ( browser )
1313
1414 const button = await queryByText ( 'Text that does not exist' )
1515 expect ( button ) . toBeNull ( )
1616 } )
1717
1818 it ( 'getBy resolves with matching element' , async ( ) => {
19- const { getByText} = await setupBrowser ( browser )
19+ const { getByText} = setupBrowser ( browser )
2020
2121 const button = await getByText ( 'Unique Button Text' )
2222 expect ( await button . getText ( ) ) . toEqual ( 'Unique Button Text' )
2323 } )
2424
2525 it ( 'getBy rejects when there are no matching elements' , async ( ) => {
26- const { getByText} = await setupBrowser ( browser )
26+ const { getByText} = setupBrowser ( browser )
2727
2828 await expect ( getByText ( 'Text that does not exist' ) ) . rejects . toThrow ( )
2929 } )
3030
3131 it ( 'getBy rejects when there are multiple matching elements' , async ( ) => {
32- const { getByText} = await setupBrowser ( browser )
32+ const { getByText} = setupBrowser ( browser )
3333
3434 await expect ( getByText ( 'Button Text' ) ) . rejects . toThrow ( )
3535 } )
3636
3737 it ( 'findBy waits for matching element and resolves with it' , async ( ) => {
38- const { findByText} = await setupBrowser ( browser )
38+ const { findByText} = setupBrowser ( browser )
3939
4040 const button = await findByText ( 'Unique Delayed Button Text' )
4141 expect ( await button . getText ( ) ) . toEqual ( 'Unique Delayed Button Text' )
4242 } )
4343
4444 it ( 'findBy rejects when there is no matching element after timeout' , async ( ) => {
45- const { findByText} = await setupBrowser ( browser )
45+ const { findByText} = setupBrowser ( browser )
4646
4747 await expect ( findByText ( 'Text that does not exist' ) ) . rejects . toThrow ( )
4848 } )
4949
5050 it ( 'findBy rejects when there are multiple matching elements' , async ( ) => {
51- const { findByText} = await setupBrowser ( browser )
51+ const { findByText} = setupBrowser ( browser )
5252
5353 await expect ( findByText ( 'Delayed Button Text' ) ) . rejects . toThrow ( )
5454 } )
5555
5656 it ( 'queryAllBy resolves with matching elements' , async ( ) => {
57- const { queryAllByText} = await setupBrowser ( browser )
57+ const { queryAllByText} = setupBrowser ( browser )
5858
5959 const chans = await queryAllByText ( 'Button Text' )
6060 expect ( chans ) . toHaveLength ( 2 )
6161 } )
6262
6363 it ( 'queryAllBy resolves with an empty array when there are no matching elements' , async ( ) => {
64- const { queryAllByText} = await setupBrowser ( browser )
64+ const { queryAllByText} = setupBrowser ( browser )
6565
6666 const chans = await queryAllByText ( 'Text that does not exist' )
6767 expect ( chans ) . toHaveLength ( 0 )
6868 } )
6969
7070 it ( 'getAllBy resolves matching elements' , async ( ) => {
71- const { getAllByText} = await setupBrowser ( browser )
71+ const { getAllByText} = setupBrowser ( browser )
7272
7373 const buttons = await getAllByText ( 'Button Text' )
7474 expect ( buttons ) . toHaveLength ( 2 )
7575 } )
7676
7777 it ( 'getAllBy rejects when there are no matching elements' , async ( ) => {
78- const { getAllByText} = await setupBrowser ( browser )
78+ const { getAllByText} = setupBrowser ( browser )
7979
8080 await expect ( getAllByText ( 'Text that does not exist' ) ) . rejects . toThrow ( )
8181 } )
8282
8383 it ( 'findAllBy waits for matching elements and resolves with them' , async ( ) => {
84- const { findAllByText} = await setupBrowser ( browser )
84+ const { findAllByText} = setupBrowser ( browser )
8585
8686 const buttons = await findAllByText ( 'Delayed Button Text' )
8787 expect ( buttons ) . toHaveLength ( 2 )
8888 } )
8989
9090 it ( 'findAllBy rejects when there are no matching elements after timeout' , async ( ) => {
91- const { findAllByText} = await setupBrowser ( browser )
91+ const { findAllByText} = setupBrowser ( browser )
9292
9393 await expect ( findAllByText ( 'Text that does not exist' ) ) . rejects . toThrow ( )
9494 } )
9595
9696 it ( 'can click resolved elements' , async ( ) => {
97- const { getByText, getAllByText} = await setupBrowser ( browser )
97+ const { getByText, getAllByText} = setupBrowser ( browser )
9898
9999 const uniqueButton = await getByText ( 'Unique Button Text' )
100100 const buttons = await getAllByText ( 'Button Text' )
@@ -109,29 +109,29 @@ describe('queries', () => {
109109 } )
110110
111111 it ( 'support Regular Expressions' , async ( ) => {
112- const { getAllByText} = await setupBrowser ( browser )
112+ const { getAllByText} = setupBrowser ( browser )
113113
114114 const chans = await getAllByText ( / J a c k i e C h a n / )
115115 expect ( chans ) . toHaveLength ( 2 )
116116 } )
117117
118118 it ( 'support options' , async ( ) => {
119- const { getAllByText} = await setupBrowser ( browser )
119+ const { getAllByText} = setupBrowser ( browser )
120120
121121 const chans = await getAllByText ( 'Jackie Chan' , { exact : false } )
122122 expect ( chans ) . toHaveLength ( 2 )
123123 } )
124124
125125 it ( 'support waitFor options' , async ( ) => {
126- const { findByText} = await setupBrowser ( browser )
126+ const { findByText} = setupBrowser ( browser )
127127
128128 await expect (
129129 findByText ( 'Unique Delayed Button Text' , { } , { timeout : 0 } ) ,
130130 ) . rejects . toThrow ( )
131131 } )
132132
133133 it ( 'support being passed undefined arguments' , async ( ) => {
134- const { findByText} = await setupBrowser ( browser )
134+ const { findByText} = setupBrowser ( browser )
135135
136136 const button = await findByText (
137137 'Unique Delayed Button Text' ,
@@ -142,7 +142,7 @@ describe('queries', () => {
142142 } )
143143
144144 it ( 'retains error messages' , async ( ) => {
145- const { getByText} = await setupBrowser ( browser )
145+ const { getByText} = setupBrowser ( browser )
146146
147147 await expect ( getByText ( 'Text that does not exist' ) ) . rejects . toThrowError (
148148 / U n a b l e t o f i n d a n e l e m e n t w i t h t h e t e x t / ,
0 commit comments