Skip to content

Commit

Permalink
fix(storage) add link to storage pool from storage volume, add test f…
Browse files Browse the repository at this point in the history
…or storage pool used by storage volume link WD-8591

Signed-off-by: David Edler <david.edler@canonical.com>
  • Loading branch information
edlerd committed Feb 28, 2024
1 parent 9881d18 commit 7609084
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/pages/storage/StorageVolumeOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LxdStorageVolume } from "types/storage";
import { isoTimeToString } from "util/helpers";
import StorageVolumeSize from "pages/storage/StorageVolumeSize";
import { renderContentType, renderVolumeType } from "util/storageVolume";
import { Link } from "react-router-dom";

interface Props {
project: string;
Expand Down Expand Up @@ -49,6 +50,16 @@ const StorageVolumeOverview: FC<Props> = ({ project, volume }) => {
<th className="p-muted-heading">Location</th>
<td>{volume.location}</td>
</tr>
<tr>
<th className="p-muted-heading">Pool</th>
<td>
<Link
to={`/ui/project/${project}/storage/detail/${volume.pool}`}
>
{volume.pool}
</Link>
</td>
</tr>
<tr>
<th className="p-muted-heading">Date created</th>
<td>{isoTimeToString(volume.created_at)}</td>
Expand Down
9 changes: 8 additions & 1 deletion tests/storage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from "./fixtures/lxd-test";
import { expect, test } from "./fixtures/lxd-test";
import {
createPool,
deletePool,
Expand Down Expand Up @@ -105,3 +105,10 @@ test("custom storage volume add snapshot from CTA", async ({ page }) => {

await deleteVolume(page, volume);
});

test("navigate to custom volume via pool used by list", async ({ page }) => {
await visitVolume(page, volume);
await page.locator(`tr:has-text("Pool")`).getByRole("link").click();
await page.getByRole("link", { name: volume }).click();
await expect(page).toHaveURL(/volumes\/custom\//);
});

0 comments on commit 7609084

Please sign in to comment.