-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathinitApp.spec.js
40 lines (36 loc) · 1.09 KB
/
initApp.spec.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
33
34
35
36
37
38
39
40
describe('App Initialization Smoke Test', () => {
beforeEach(() => {
cy.visitAndClear();
cy.fixture('userStubs.json').then((stub) =>
cy.get('.CodeMirror textarea').first().type(stub.html.helloWorld, {
force: true,
}),
);
cy.fixture('userStubs.json').then((stub) =>
cy.get('.CodeMirror textarea').eq(1).type(stub.query.helloWorld, {
force: true,
}),
);
});
it('Gives a suggested query more specific than the used data-testid', () => {
cy.get('[data-cy=suggested-query]').should(
'contain',
"screen.getByText('Hello World')",
);
cy.get('.query-editor > .w-full > .CodeMirror').should(
'contain',
"screen.getByTestId('hello')",
);
});
it('Clicking on the suggested query changes the query in code field', () => {
cy.get('[data-cy=suggested-query]').click();
cy.get('[data-cy=suggested-query]').should(
'contain',
"screen.getByText('Hello World')",
);
cy.get('.query-editor > .w-full > .CodeMirror').should(
'contain',
"screen.getByText('Hello World')",
);
});
});