forked from podman-desktop/extension-bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the disk image related files into the disk-image folder, and rename using the same pattern we use for columns in Podman Desktop. While I was there I updated most imports to '/@' syntax. Also thought of another test for the Navigation and added that. Fixes podman-desktop#886. Signed-off-by: Tim deBoer <[email protected]>
- Loading branch information
1 parent
6f9366a
commit d3e2e3e
Showing
11 changed files
with
88 additions
and
29 deletions.
There are no files selected for viewing
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,59 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 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. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import '@testing-library/jest-dom/vitest'; | ||
|
||
import { render, screen } from '@testing-library/svelte'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import Navigation from './Navigation.svelte'; | ||
import type { TinroRouteMeta } from 'tinro'; | ||
|
||
test('Expect panel to have correct styling', async () => { | ||
render(Navigation, { meta: { url: 'test' } as TinroRouteMeta }); | ||
|
||
const panel = screen.getByLabelText('Navigation'); | ||
expect(panel).toBeInTheDocument(); | ||
expect(panel).toHaveClass('bg-[var(--pd-secondary-nav-bg)]'); | ||
expect(panel).toHaveClass('border-[var(--pd-global-nav-bg-border)]'); | ||
expect(panel).toHaveClass('border-r-[1px]'); | ||
}); | ||
|
||
test('Expect dashboard to be selected', async () => { | ||
render(Navigation, { meta: { url: '/' } as TinroRouteMeta }); | ||
|
||
const dashboard = screen.getByText('Dashboard'); | ||
expect(dashboard).toBeInTheDocument(); | ||
expect(dashboard.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)]'); | ||
}); | ||
|
||
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)]'); | ||
|
||
const diskImages = screen.getByText('Disk Images'); | ||
expect(diskImages).toBeInTheDocument(); | ||
expect(diskImages.parentElement).toHaveClass('text-[color:var(--pd-secondary-nav-text-selected)]'); | ||
}); |
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
4 changes: 2 additions & 2 deletions
4
...ages/frontend/src/lib/BootcActions.svelte → ...rc/lib/disk-image/DiskImageActions.svelte
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
4 changes: 2 additions & 2 deletions
4
...rontend/src/lib/BootcColumnActions.svelte → .../disk-image/DiskImageColumnActions.svelte
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<script lang="ts"> | ||
import type { BootcBuildInfo } from '/@shared/src/models/bootc'; | ||
import BootcActions from './BootcActions.svelte'; | ||
import DiskImageActions from './DiskImageActions.svelte'; | ||
export let object: BootcBuildInfo; | ||
</script> | ||
|
||
<BootcActions object={object} on:update /> | ||
<DiskImageActions object={object} on:update /> |
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
2 changes: 1 addition & 1 deletion
2
...frontend/src/lib/BootcFolderColumn.svelte → ...b/disk-image/DiskImageColumnFolder.svelte
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
File renamed without changes.
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