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