datahub/cypress/integration/pages/search-spec.js
Gift Egwuenu d9b5c4ddbd
[tests][m]: Setup Integration Tests with Cypress (#26).
* [cypress][s]-setup-integration=with-cypress
* [fix][s]- fix typescript bug 'All files must be modules when the '--isolatedModules' flag is provided' by adding an 'export {}' to all test files
* Fixes of cypress tests
* Use yarn everywhere not npm

Co-authored-by: Abhishek Gahlot <me@abhishek.it>
2020-07-17 17:16:26 +02:00

19 lines
548 B
JavaScript

describe('Test Search Page', () => {
beforeEach(() => {
cy.visit('/search');
});
it('has a search form', () => {
cy.contains('form');
cy.contains('Search');
});
it('should return a search result', () => {
cy.get('form').find('[type="text"]').type('world population');
cy.get('form').submit();
cy.url().should('include', 'search?q=world%20population&sort=');
cy.get('.text-3xl').should('have.text', '1 results found');
cy.get('.text-xl > .text-primary').should('have.text', 'World Population');
});
});