Skip to content

Commit d64c2b3

Browse files
authored
Fixed redirection when clicking on DiffTree item (#7444)
1 parent 6f9ff2a commit d64c2b3

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

frontend/app/src/shared/components/tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const Tabs = (props: TabsProps) => {
2626

2727
const [qspTab, setQspTab] = useQueryState(
2828
qsp ?? QSP.TAB,
29-
parseAsString.withOptions({ history: "push" })
29+
parseAsString.withOptions({ history: "push", shallow: false })
3030
);
3131

3232
const handleClick = (tab: Tab, index: number) => {

frontend/app/tests/e2e/proposed-changes/proposed-changes.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ import { createBranchAPI, deleteBranchAPI } from "../utils/graphql";
77
test.describe("/proposed-changes", () => {
88
test.describe.configure({ mode: "serial" });
99

10-
test.beforeEach(async function ({ page }) {
11-
page.on("response", async (response) => {
12-
if (response.status() === 500) {
13-
await expect(response.url()).toBe("This URL responded with a 500 status");
14-
}
15-
});
16-
});
17-
1810
test.describe("when not logged in", () => {
1911
test("should not be able to create a proposed changes", async ({ page }) => {
2012
await page.goto("/proposed-changes");

frontend/app/tests/e2e/proposed-changes/proposed-changes_diff.spec.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ test.describe("/proposed-changes diff data", () => {
66
test.describe.configure({ mode: "serial" });
77
test.use({ storageState: ACCOUNT_STATE_PATH.ADMIN });
88

9-
test.beforeEach(async function ({ page }) {
10-
page.on("response", async (response) => {
11-
if (response.status() === 500) {
12-
await expect(response.url()).toBe("This URL responded with a 500 status");
13-
}
14-
});
15-
});
16-
179
test("should verify the diff data with conflicts", async ({ page }) => {
1810
await test.step("create a new proposed change with reviewers", async () => {
1911
await page.goto("/proposed-changes");
@@ -24,7 +16,7 @@ test.describe("/proposed-changes diff data", () => {
2416
await page.getByLabel("Reviewers").click();
2517
await page.getByRole("option", { name: "Admin" }).click();
2618
await page.getByLabel("Reviewers").click();
27-
await page.getByRole("button", { name: "Open" }).click();
19+
await page.getByRole("button", { name: "Open", exact: true }).click();
2820
await expect(page.getByText("Proposed change created")).toBeVisible();
2921
await page.getByText("Data").click();
3022
});
@@ -41,12 +33,16 @@ test.describe("/proposed-changes diff data", () => {
4133
await expect(
4234
page.getByText("UpdatedInterfaceL3Ethernet1 main den1-maintenance-")
4335
).toBeVisible();
44-
await page.getByText("UpdatedDeviceden1-edge1").click();
36+
await page.getByLabel("diff tree").getByText("den1-edge1").click();
4537
await page
4638
.getByText(
4739
"main den1-maintenance-conflictstatusConflictactiveprovisioningmaintenanceChoose"
4840
)
4941
.click();
42+
const hash = await page.evaluate(() => window.location.hash);
43+
const highlightedNodeDiff = page.locator(`id=${hash.slice(1)}`);
44+
await expect(highlightedNodeDiff).toBeInViewport();
45+
await expect(highlightedNodeDiff).toContainClass("ring-2 ring-custom-blue-500");
5046
});
5147

5248
await test.step("resolve conflict", async () => {

0 commit comments

Comments
 (0)