-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds support for basic match rule editing. Comfort features like re-parsing transactions during the import and adding match rules from a running import will be added at a later date.
- Loading branch information
1 parent
b4fa1c6
commit 5339b98
Showing
12 changed files
with
438 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { createAccount, createBudget } from '../support/setup' | ||
|
||
describe('Account: Creation', () => { | ||
beforeEach(() => { | ||
// prepare & select a budget | ||
cy.wrap(createBudget({ name: 'Match Rule Test' })).then(budget => { | ||
cy.wrap(budget).as('budget') | ||
cy.visit('/').get('li').contains('Open').click() | ||
}) | ||
}) | ||
|
||
it('can edit match rules', function () { | ||
cy.wrap( | ||
Cypress.Promise.all([ | ||
createAccount( | ||
{ name: 'The Grocery Store', external: true }, | ||
this.budget | ||
), | ||
createAccount( | ||
{ name: 'My Favorite Restaurant', external: true }, | ||
this.budget | ||
), | ||
]) | ||
) | ||
|
||
cy.contains('Settings').click() | ||
cy.getByTitle('Edit match rules').first().click() | ||
cy.awaitLoading() | ||
|
||
cy.getByTitle('Add match rule').first().click() | ||
cy.getInputFor('Match').first().type('Restaurant*') | ||
cy.getAutocompleteFor('Account').first().type('My Favorite') | ||
cy.contains('My Favorite Rest').click() | ||
|
||
cy.getByTitle('Add match rule').first().click() | ||
cy.getInputFor('Match').first().type('Groceries*') | ||
cy.getAutocompleteFor('Account').first().type('Grocery') | ||
cy.contains('The Grocery').click() | ||
|
||
cy.getByTitle('Save').click() | ||
cy.contains('Changes saved successfully') | ||
|
||
// FIXME: Does not click/delete yet | ||
cy.contains('Delete').first().click({ force: true }) | ||
cy.contains('Groceries*').should('not.exist') | ||
|
||
cy.getByTitle('Save').click() | ||
cy.contains('Changes saved successfully') | ||
|
||
cy.reload() | ||
// We need to wait for a second so that the awaitLoading can actually | ||
// see the loading spinner and wait for it to disappear | ||
cy.wait(1000) | ||
cy.awaitLoading() | ||
|
||
// Verify that only one match rule exists | ||
cy.getInputFor('Match').should('have.length', 1) | ||
|
||
// Verify that correct match rule still exists | ||
cy.getInputFor('Match').first().should('have.value', 'Restaurant*') | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.