11import { module , test } from 'qunit' ;
22import { setupApplicationTest } from 'ember-qunit' ;
33import 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' ;
135
146module ( 'Acceptance | Search' , function ( hooks ) {
157 setupApplicationTest ( hooks ) ;
@@ -19,29 +11,19 @@ module('Acceptance | Search', function (hooks) {
1911 await visit ( '/' ) ;
2012 await fillIn ( '[data-test-search-box-input]' , 'quickstart' ) ;
2113
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 } ) ;
2815
29- await click ( find ( '[data-test-search-result] a' ) ) ;
16+ await click ( '[data-test-search-result] a' ) ;
3017 assert . equal ( currentURL ( ) , '/docs/quickstart' ) ;
3118 } ) ;
3219
3320 test ( 'search works for API pages' , async function ( assert ) {
3421 await visit ( '/' ) ;
3522 await fillIn ( '[data-test-search-box-input]' , 'hero' ) ;
3623
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 } ) ;
4325
44- await click ( find ( '[data-test-search-result] a' ) ) ;
26+ await click ( '[data-test-search-result] a' ) ;
4527 assert . equal ( currentURL ( ) , '/docs/api/components/docs-hero' ) ;
4628 } ) ;
4729} ) ;
0 commit comments