Skip to content

Commit

Permalink
test(27113): add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanch3d committed Jan 14, 2025
1 parent 781c4d0 commit 1818e6b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ describe('DesignerToolbox', () => {
cy.viewport(850, 600)
})

it('should renders properly', () => {
it('should render properly', () => {
cy.mountWithProviders(<DesignerToolbox />, { wrapper })
cy.getByTestId('toolbox-trigger').should('have.attr', 'aria-expanded', 'false')
cy.getByTestId('toolbox-container').should('not.be.visible')

cy.getByTestId('toolbox-trigger').click()
cy.getByTestId('toolbox-trigger').should('have.attr', 'aria-expanded', 'true')
cy.getByTestId('toolbox-container').should('be.visible')

cy.getByTestId('toolbox-container').find('header').should('have.text', 'Policy Toolbox')
})

it('should be accessible', () => {
cy.injectAxe()
cy.mountWithProviders(<DesignerToolbox />, { wrapper })
cy.getByTestId('toolbox-trigger').click()

cy.wait(100) // Wait for dropdown (ugly)

cy.checkAccessibility()
cy.percySnapshot('Component: DesignerToolbox')
})
Expand Down

0 comments on commit 1818e6b

Please sign in to comment.