1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-06 03:02:34 +01:00
invoiceninja/cypress/integration/client_portal/invoices.spec.js
2020-06-30 14:53:30 +02:00

74 lines
1.9 KiB
JavaScript
Vendored

context('Invoices', () => {
beforeEach(() => {
cy.clientLogin();
});
it('should show invoices page', () => {
cy.visit('/client/invoices');
cy.location().should(location => {
expect(location.pathname).to.eq('/client/invoices');
});
});
it('should show invoices text', () => {
cy.visit('/client/invoices');
cy.get('body')
.find('span')
.first()
.should('contain.text', 'Invoices');
});
it('should show download and pay now buttons', () => {
cy.visit('/client/invoices');
cy.get('body')
.find('button[value="download"]')
.first()
.should('contain.text', 'Download');
cy.get('body')
.find('button[value="payment"]')
.first()
.should('contain.text', 'Pay Now');
});
it('should have per page options dropdown', () => {
cy.visit('/client/invoices');
cy.get('body')
.find('select')
.first()
.should('have.value', '10');
});
it('should have required table elements', () => {
cy.visit('/client/invoices');
cy.get('body')
.find('table.invoices-table > tbody > tr')
.first()
.find('.button-link')
.first()
.should('contain.text', 'View')
.click()
.location()
.should(location => {
expect(location.pathname).to.eq('/client/invoices/VolejRejNm');
});
});
it('should filter table content', () => {
cy.visit('/client/invoices');
cy.get('body')
.find('#paid-checkbox')
.check();
cy.get('body')
.find('table.invoices-table > tbody > tr')
.first()
.should('not.contain', 'Overdue');
});
});