Skip to content

Commit

Permalink
fix: update setting nav test to match 1.16
Browse files Browse the repository at this point in the history
Fixes #1235.

Signed-off-by: Tim deBoer <[email protected]>
  • Loading branch information
deboer-tim authored and benoitf committed Jan 31, 2025
1 parent 8d90bf8 commit 8ff09f6
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions packages/frontend/src/Navigation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (C) 2024 Red Hat, Inc.
* Copyright (C) 2024-2025 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,21 +39,45 @@ test('Expect dashboard to be selected', async () => {

const dashboard = screen.getByText('Dashboard');
expect(dashboard).toBeInTheDocument();
expect(dashboard.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
expect(dashboard.parentElement?.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const diskImages = screen.getByText('Disk Images');
expect(diskImages).toBeInTheDocument();
expect(diskImages.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
expect(diskImages.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const examples = screen.getByText('Examples');
expect(examples).toBeInTheDocument();
expect(examples.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
});

test('Expect disk images to be selected', async () => {
render(Navigation, { meta: { url: '/disk-images' } as TinroRouteMeta });

const dashboard = screen.getByText('Dashboard');
expect(dashboard).toBeInTheDocument();
expect(dashboard.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
expect(dashboard.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const diskImages = screen.getByText('Disk Images');
expect(diskImages).toBeInTheDocument();
expect(diskImages.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
expect(diskImages.parentElement?.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const examples = screen.getByText('Examples');
expect(examples).toBeInTheDocument();
expect(examples.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
});

test('Expect examples to be selected', async () => {
render(Navigation, { meta: { url: '/examples' } as TinroRouteMeta });

const dashboard = screen.getByText('Dashboard');
expect(dashboard).toBeInTheDocument();
expect(dashboard.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const diskImages = screen.getByText('Disk Images');
expect(diskImages).toBeInTheDocument();
expect(diskImages.parentElement?.parentElement).not.toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');

const examples = screen.getByText('Examples');
expect(examples).toBeInTheDocument();
expect(examples.parentElement?.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]');
});

0 comments on commit 8ff09f6

Please sign in to comment.