1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

remove plaid tests from account.cy.ts

This commit is contained in:
Karan Handa 2024-01-19 14:25:34 +05:30
parent 81702f667b
commit c5a4374cf2

View file

@ -19,81 +19,6 @@ function openEditAccountModal() {
}
describe('Accounts', () => {
it('should sync and edit a plaid connection', () => {
cy.apiRequest({
method: 'POST',
url: 'e2e/plaid/connect',
}).then((response) => {
expect(response.status).to.eql(200)
// The only time we need to manually send a Plaid webhook is in Github actions when testing a PR
if (Cypress.env('WEBHOOK_TYPE') === 'mock') {
const { plaidItemId } = response.body.data.json
cy.request({
method: 'POST',
url: `${Cypress.env('API_URL')}/plaid/webhook`,
body: {
webhook_type: 'TRANSACTIONS',
webhook_code: 'HISTORICAL_UPDATE',
item_id: plaidItemId,
},
})
.its('status')
.should('equal', 200)
}
})
// Check account sidebar names and balances
cy.visit('/accounts')
cy.getByTestId('account-group', { timeout: 20_000 })
assertSidebarAccounts([
['Assets', '$20,000'],
['Cash', '$20,000'],
['Sandbox Savings', '$15,000'],
['Sandbox Checking', '$5,000'],
['Debts', '$950'],
['Credit Cards', '$950'],
['Sandbox CC', '$950'],
])
// Check current net worth
cy.visit('/')
cy.getByTestId('current-data-value').should('contain.text', '$19,050.00')
// Visit each account page, edit details, re-validate amounts
cy.contains('a', 'Sandbox Checking').click()
cy.getByTestId('current-data-value').should('contain.text', '$5,000.00')
cy.contains('a', 'Sandbox Savings').click()
cy.getByTestId('current-data-value').should('contain.text', '$15,000.00')
cy.contains('a', 'Sandbox CC').click()
cy.getByTestId('current-data-value').should('contain.text', '$950.00')
openEditAccountModal()
cy.getByTestId('connected-account-form').within(() => {
cy.get('input[name="name"]')
.should('have.value', 'Sandbox CC')
.clear()
.type('Credit Credit')
cy.get('input[name="categoryUser"]').should('have.value', 'credit')
cy.get('input[name="startDate"]')
.should('have.value', '')
.type(DateTime.now().minus({ months: 1 }).toFormat('MMddyyyy'))
cy.root().submit()
})
// Should be able to submit empty start date on connected account
openEditAccountModal()
cy.getByTestId('connected-account-form').within(() => {
cy.get('input[name="startDate"]').clear()
cy.root().submit()
})
})
it('should interpolate and display manual vehicle account data', () => {
cy.getByTestId('add-account-button').click()
cy.contains('h4', 'Add account')