/
test.js
32 lines (26 loc) · 924 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import expect from 'expect';
import {searchBox, prepareScreenshot} from './utils.js';
describe('searchBox', () => {
describe('when there is no query', () => {
beforeEach(() => searchBox.clear());
it('input is empty', () => expect(searchBox.get()).toBe(''));
it('triggers an empty search', () => {
expect(browser.getText('#hits')).toNotContain('MP3');
prepareScreenshot();
browser.checkDocument({
hide: ['.ais-stats--body'], // Flaky X ms information.
});
});
});
describe('when there is a query', () => {
beforeEach(() => searchBox.set('mp3'));
it('fills the input', () => expect(searchBox.get()).toBe('mp3'));
it('triggers a new search', () => {
expect(browser.getText('#hits')).toContain('MP3');
prepareScreenshot();
browser.checkDocument({
hide: ['.ais-stats--body'], // Flaky X ms information.
});
});
});
});