Skip to content

Commit

Permalink
fix: make assertions directly on readBudget chainable
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphe committed May 8, 2020
1 parent 323df7a commit 7bf13ef
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions cypress/integration/createNewBudget.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,18 @@ describe('Create New Budget', () => {

cy.findByText(/Create "My New Budget"/i).click();

cy.readBudget('/my_new.budget').then(({ name, version, settings }) => {
expect(name).to.equal('My New Budget');
expect(version).to.equal('0.0.2');
expect(settings).to.be.an('object');
expect(settings.accounts).to.deep.equal([accounts[0].uuid]);
expect(settings.numberLocale).to.equal('de-DE');
expect(settings.startDate).to.equal(1562457600000);
expect(settings.incomeCategories).to.deep.equal([
{ id: categories[1].uuid, availableIn: 0 },
]);
});
cy.readBudget('/my_new.budget')
.should('include', {
name: 'My New Budget',
version: '0.0.2',
})
.and('deep.nested.include', {
'settings.accounts': [accounts[0].uuid],
'settings.numberLocale': 'de-DE',
'settings.startDate': 1562457600000,
'settings.incomeCategories': [
{ id: categories[1].uuid, availableIn: 0 },
],
});
});
});

0 comments on commit 7bf13ef

Please sign in to comment.