ys9693 | 16a9fce | 2020-01-19 13:50:02 +0200 | [diff] [blame^] | 1 | import {initCommonFixtures} from "../common/init"; |
| 2 | |
| 3 | describe('Home (Dashboard) Screen', () => { |
| 4 | beforeEach(() => { |
| 5 | cy.server(); |
| 6 | initCommonFixtures(cy); |
| 7 | |
| 8 | // Followed Resources for the dashboard screen |
| 9 | cy.fixture('home/followed').as('followed'); |
| 10 | cy.route('GET', '**/followed', '@followed'); |
| 11 | }); |
| 12 | |
| 13 | it('Test that only Certify and Distributed appear in followed projects filter', function () { |
| 14 | const homePageUrl = '#!/dashboard'; |
| 15 | cy.visit(homePageUrl); |
| 16 | |
| 17 | // Test that tiles are sorted |
| 18 | cy.get('ui-tile .multiline-ellipsis-content'). |
| 19 | first().should('include.text', 'MyVSP1'). |
| 20 | last().should('include.text', 'MyVSP1'); |
| 21 | |
| 22 | // Test that there are 5 components tiles |
| 23 | cy.get('ui-tile .multiline-ellipsis-content').should('have.length', 5); |
| 24 | |
| 25 | |
| 26 | cy.get('[data-tests-id="filter-CERTIFIED"]').should('be.visible'); |
| 27 | cy.get('[data-tests-id="filter-DISTRIBUTED"]').should('be.visible'); // Ready for Testing |
| 28 | cy.get('[data-tests-id="count-DISTRIBUTED"]').should('have.text', '1'); |
| 29 | cy.get('[data-tests-id="filter-CERTIFICATION_IN_PROGRESS"]').should('not.be.visible'); // In Testing |
| 30 | cy.get('[data-tests-id="filter-READY_FOR_CERTIFICATION"]').should('not.be.visible'); // Ready for Testing |
| 31 | }); |
| 32 | }); |