-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mhv 61347 add filters to list page (#31951)
* [] created accordion filter component, with basic smoke unit tests. * [mhv-61347] added accordion to prescriptions container, hid accordion and content relocation under the filter feature flag, updated unit test to include accordion behind the ff. * [mhv-61347] fixed misaligned icon. * [mhv-61347] comment for icon fix. * e2e test filter accordion added e2e test to validate filter accordion, medications list h2 and refill link text update * [MHV 61347] added the sort back regardless of ff status. * e2e sort med list added the sort tests back --------- Co-authored-by: raji.venkatesh <raji.venkatesh@acommsolutions.com>
- Loading branch information
1 parent
2d6d7e5
commit 0a34c24
Showing
8 changed files
with
143 additions
and
16 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/applications/mhv-medications/components/MedicationsList/MedicationsListFilter.jsx
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,15 @@ | ||
import React from 'react'; | ||
|
||
const MedicationsListFilter = () => { | ||
return ( | ||
<va-accordion open-single data-testid="filter-accordion"> | ||
<va-accordion-item header="Filter" id="filter"> | ||
<span slot="icon"> | ||
<va-icon aria-hidden="true" icon="filter_alt" /> | ||
</span> | ||
</va-accordion-item> | ||
</va-accordion> | ||
); | ||
}; | ||
|
||
export default MedicationsListFilter; |
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
21 changes: 21 additions & 0 deletions
21
...ions/mhv-medications/tests/components/MedicationsList/MedicationsListFilter.unit.spec.jsx
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,21 @@ | ||
import { render } from '@testing-library/react'; | ||
import { expect } from 'chai'; | ||
import React from 'react'; | ||
import MedicationsListFilter from '../../../components/MedicationsList/MedicationsListFilter'; | ||
|
||
describe('Medicaitons List Filter component', () => { | ||
const setup = () => { | ||
return render(<MedicationsListFilter />); | ||
}; | ||
|
||
it('renders without errors', () => { | ||
const screen = setup(); | ||
expect(screen); | ||
}); | ||
|
||
it('renders accordion', () => { | ||
const screen = setup(); | ||
const accordion = screen.getByTestId('filter-accordion'); | ||
expect(accordion).to.exist; | ||
}); | ||
}); |
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
18 changes: 18 additions & 0 deletions
18
...ications/mhv-medications/tests/e2e/medications-filter-accordion-list-page.cypress.spec.js
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,18 @@ | ||
import MedicationsSite from './med_site/MedicationsSite'; | ||
import MedicationsLandingPage from './pages/MedicationsLandingPage'; | ||
import MedicationsListPage from './pages/MedicationsListPage'; | ||
|
||
describe('Medications List Page Filter', () => { | ||
it('visits Medications List Page Filter Accordion', () => { | ||
const site = new MedicationsSite(); | ||
const listPage = new MedicationsListPage(); | ||
const landingPage = new MedicationsLandingPage(); | ||
site.login(); | ||
landingPage.visitLandingPageURL(); | ||
cy.injectAxe(); | ||
cy.axeCheck('main'); | ||
listPage.clickGotoMedicationsLink(); | ||
listPage.verifyMedicationsListHeaderTextOnListPage(); | ||
listPage.verifyFilterAccordionOnMedicationsListPage(); | ||
}); | ||
}); |
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