Skip to content

Commit

Permalink
22685 - To Do Action - handling extra name request info (#43)
Browse files Browse the repository at this point in the history
* 22685 - expander content added.

* 22685 - expander content updated, subitle handled.

* 22685 - tests part 1

* Fixing sync issue (race condition while loading bootstrap business).

* 22685 - tests part 2

* eslint fixes...

* Address change icon color update.

* Removing unnecessary comment.

* PR updates.
  • Loading branch information
hfekete authored Sep 16, 2024
1 parent c7f8503 commit 3c9f271
Show file tree
Hide file tree
Showing 19 changed files with 948 additions and 82 deletions.
184 changes: 184 additions & 0 deletions cypress/e2e/components/todos/name-request-draft.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import { DraftFilingSolePropWithNr } from '../../../fixtures/filings/draft/sole-prop-with-nr'
import { SolePropNr } from '../../../fixtures/name-requests/soleProp'
import { DraftFilingIncorporationApplicationNumbered } from '../../../fixtures/filings/draft/incorporation-applicaton'
import { DraftFilingAmalgamationApplication } from '../../../fixtures/filings/draft/amalgamation-application'
import {
DraftFilingCorporationContinuationApplication
} from '../../../fixtures/filings/draft/corporation-continuation-application'

context('TODOs -> Draft Filings', () => {
it('Sole Prop with NR - expires today', () => {
const draftFiling = DraftFilingSolePropWithNr
const nameRequest = Object.assign({}, SolePropNr)

const today = new Date()
nameRequest.expirationDate = today.toISOString()

cy.intercept(
'GET',
'**/api/v2/nameRequests/**/validate**',
nameRequest
).as('nameRequest')

cy.visitTempBusinessDash(draftFiling, false)
cy.wait('@nameRequest')

cy.get('[data-cy="header_todo"]').should('exist')
cy.get('[data-cy="todoItemList"]').should('exist')

// subtitle
cy.get('[data-cy^="todoItem-label-"]')
.should('exist')
.contains('NR APPROVED - Expires today')

// View More button exists
cy.get('[data-cy^="todoItem-showMore-"]').should('exist')
cy.get('[data-cy^="todoItem-showMore-"]').click()

// extended content
cy.get('[data-cy="todoItem-content"]').should('exist').contains('Name Request')

// The action button exists
cy.get('[data-cy^="todoItemActions-"]')
.find('button')
.should('exist')
.should('have.text', 'Register using this NR')

// no dropdown menu
cy.get('[data-cy="popover-button"]').should('exist').click()

cy.get('[data-cy="menu-button-0"]')
.should('exist')
.should('have.text', 'Delete Registration')
})

it('Sole Prop with NR expire in 10 days', () => {
const draftFiling = DraftFilingSolePropWithNr
const nameRequest = Object.assign({}, SolePropNr)

const in10days = new Date()
in10days.setDate(in10days.getDate() + 10)
nameRequest.expirationDate = in10days.toISOString()

cy.intercept(
'GET',
'**/api/v2/nameRequests/**/validate**',
nameRequest
).as('nameRequest')

cy.visitTempBusinessDash(draftFiling, false)
cy.wait('@nameRequest')

cy.get('[data-cy="header_todo"]').should('exist')
cy.get('[data-cy="todoItemList"]').should('exist')

// subtitle
cy.get('[data-cy^="todoItem-label-"]')
.should('exist')
.contains('NR APPROVED - Expires in 10 days')

// View More button exists
cy.get('[data-cy^="todoItem-showMore-"]').should('exist')
cy.get('[data-cy^="todoItem-showMore-"]').click()

// extended content
cy.get('[data-cy="todoItem-content"]').should('exist').contains('Name Request')

// The action button exists
cy.get('[data-cy^="todoItemActions-"]')
.find('button')
.should('exist')
.should('have.text', 'Register using this NR')

// dropdown menu
cy.get('[data-cy="popover-button"]').should('exist').click()

cy.get('[data-cy="menu-button-0"]')
.should('exist')
.should('have.text', 'Delete Registration')
})

it('Numbered limited company (no NR)', () => {
cy.visitTempBusinessDash(DraftFilingIncorporationApplicationNumbered, false)

cy.get('[data-cy="header_todo"]').should('exist')
cy.get('[data-cy="todoItemList"]').should('exist')

// subtitle
cy.get('[data-cy^="todoItem-label-"]')
.should('exist')
.contains('DRAFT')

// View More button exists
cy.get('[data-cy^="todoItem-showMore-"]').should('not.exist')

// The action button exists
cy.get('[data-cy^="todoItemActions-"]')
.find('button')
.should('exist')
.should('have.text', 'Incorporate a Numbered Company')

cy.get('[data-cy="popover-button"]').should('exist').click()

// dropdown menu
cy.get('[data-cy="menu-button-0"]')
.should('exist')
.should('have.text', 'Delete Incorporation Application')
})

it('Amalgamation application', () => {
cy.visitTempBusinessDash(DraftFilingAmalgamationApplication, false)

cy.get('[data-cy="header_todo"]').should('exist')
cy.get('[data-cy="todoItemList"]').should('exist')

// subtitle
cy.get('[data-cy^="todoItem-label-"]')
.should('exist')
.contains('DRAFT')

// View More button exists
cy.get('[data-cy^="todoItem-showMore-"]').should('not.exist')

// The action button exists
cy.get('[data-cy^="todoItemActions-"]')
.find('button')
.should('exist')
.should('have.text', 'Resume')

cy.get('[data-cy="popover-button"]').should('exist').click()

// dropdown menu
cy.get('[data-cy="menu-button-0"]')
.should('exist')
.should('have.text', 'Delete Amalgamation Application')
})

it('BC Limited Company Continuation Application', () => {
cy.visitTempBusinessDash(DraftFilingCorporationContinuationApplication, false)

cy.get('[data-cy="header_todo"]').should('exist')
cy.get('[data-cy="todoItemList"]').should('exist')

// subtitle
cy.get('[data-cy^="todoItem-label-"]')
.should('exist')
.contains('DRAFT')

// View More button exists
cy.get('[data-cy^="todoItem-showMore-"]').should('not.exist')

// The action button exists
cy.get('[data-cy^="todoItemActions-"]')
.find('button')
.should('exist')
.should('have.text', 'Continue In as a Numbered Company')

cy.get('[data-cy="popover-button"]').should('exist').click()

// dropdown menu
cy.get('[data-cy="menu-button-0"]')
.should('exist')
.should('have.text', 'Delete Continuation Application')
})
})
36 changes: 0 additions & 36 deletions cypress/fixtures/bootstrapFiling.json

This file was deleted.

Loading

0 comments on commit 3c9f271

Please sign in to comment.