Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested routes for catalogue #1218 #1232

Merged
merged 25 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c076c88
Implement nested routes for catalogue
joshuadkitenge Jan 7, 2025
f5f4e0d
Fix tests and refactor bugs
joshuadkitenge Jan 7, 2025
95c1a25
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 8, 2025
4f159e8
use BaseLayoutHeader #1218
joshuadkitenge Jan 8, 2025
8792535
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 8, 2025
75996e9
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 8, 2025
4014463
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 8, 2025
cf0bab1
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 8, 2025
af934b3
Merge branch 'handle-404-errors-with-react-router-systems' into neste…
joshuadkitenge Jan 9, 2025
406b8de
Update the loader funxtion for the catalogue #1218
joshuadkitenge Jan 9, 2025
04a7669
Add e2e tests #1218
joshuadkitenge Jan 9, 2025
e164e8f
improve coverage #1218
joshuadkitenge Jan 9, 2025
1b35af3
Merge branch 'develop' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 9, 2025
f1a7689
Address review comments #1218
joshuadkitenge Jan 9, 2025
fe301aa
Address review comments #1218
joshuadkitenge Jan 9, 2025
522dbd8
Add unit and e2e test #1218
joshuadkitenge Jan 10, 2025
fa821d1
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 10, 2025
c82358b
Refactor the Obsolete replacement link to Catalogue link #1218
joshuadkitenge Jan 10, 2025
df8b1d4
Address review comments
joshuadkitenge Jan 10, 2025
be349bc
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 10, 2025
26519ad
Address review comments
joshuadkitenge Jan 10, 2025
d890912
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 10, 2025
7706100
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 10, 2025
a253c00
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 13, 2025
df22100
Merge branch 'fix-flaky-test' into nested-routes-for-catalogue-#1218
joshuadkitenge Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cypress/e2e/with_mock_data/catalogueItems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ describe('Catalogue Items', () => {
afterEach(() => {
cy.clearMocks();
});

it('should navigate back to the catalogue items table from the landing page using the breadcrumbs', () => {
joelvdavies marked this conversation as resolved.
Show resolved Hide resolved
cy.visit('/catalogue/5/items/89');

cy.findByRole('link', { name: 'Energy Meters' }).click();

cy.findByRole('button', { name: 'Add Catalogue Item' }).should('exist');
});
it('adds a catalogue item', () => {
cy.findByRole('button', { name: 'Add Catalogue Item' }).click();

Expand Down
18 changes: 18 additions & 0 deletions src/catalogue/catalogueLayout.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ describe('Catalogue Layout', () => {
expect(view.asFragment()).toMatchSnapshot();
});

it('navigates to catalogue category table view', async () => {
createView('/catalogue/5/items/89', 'catalogueItem');
await waitFor(() => {
expect(
screen.getByRole('link', { name: 'Energy Meters' })
).toBeInTheDocument();
});

const breadcrumb = screen.getByRole('link', {
name: 'Energy Meters',
});

await user.click(breadcrumb);

expect(mockedUseNavigate).toHaveBeenCalledTimes(1);
expect(mockedUseNavigate).toHaveBeenCalledWith('/catalogue/5/items');
});

it('renders a catalogue items page correctly', async () => {
const view = createView('/catalogue/4/items', 'catalogueItems');

Expand Down
Loading