1
1
import { module , test } from 'qunit' ;
2
2
import { setupApplicationTest } from 'ember-qunit' ;
3
3
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage' ;
4
- import {
5
- click ,
6
- currentURL ,
7
- fillIn ,
8
- find ,
9
- findAll ,
10
- visit ,
11
- waitUntil ,
12
- } from '@ember/test-helpers' ;
4
+ import { click , currentURL , fillIn , visit , waitFor } from '@ember/test-helpers' ;
13
5
14
6
module ( 'Acceptance | Search' , function ( hooks ) {
15
7
setupApplicationTest ( hooks ) ;
@@ -19,29 +11,19 @@ module('Acceptance | Search', function (hooks) {
19
11
await visit ( '/' ) ;
20
12
await fillIn ( '[data-test-search-box-input]' , 'quickstart' ) ;
21
13
22
- await waitUntil (
23
- function ( ) {
24
- return findAll ( '[data-test-search-result]' ) . length > 0 ;
25
- } ,
26
- { timeout : 2000 }
27
- ) ;
14
+ await waitFor ( '[data-test-search-result]' , { timeout : 2000 } ) ;
28
15
29
- await click ( find ( '[data-test-search-result] a' ) ) ;
16
+ await click ( '[data-test-search-result] a' ) ;
30
17
assert . equal ( currentURL ( ) , '/docs/quickstart' ) ;
31
18
} ) ;
32
19
33
20
test ( 'search works for API pages' , async function ( assert ) {
34
21
await visit ( '/' ) ;
35
22
await fillIn ( '[data-test-search-box-input]' , 'hero' ) ;
36
23
37
- await waitUntil (
38
- function ( ) {
39
- return findAll ( '[data-test-search-result]' ) . length > 0 ;
40
- } ,
41
- { timeout : 2000 }
42
- ) ;
24
+ await waitFor ( '[data-test-search-result]' , { timeout : 2000 } ) ;
43
25
44
- await click ( find ( '[data-test-search-result] a' ) ) ;
26
+ await click ( '[data-test-search-result] a' ) ;
45
27
assert . equal ( currentURL ( ) , '/docs/api/components/docs-hero' ) ;
46
28
} ) ;
47
29
} ) ;
0 commit comments