Align compare navbar state mapping with MAP and PERFORMANCE tabs
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -325,9 +325,11 @@ function getNavViewName() {
|
|||||||
break;
|
break;
|
||||||
case "COMPARE":
|
case "COMPARE":
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case "dummy":
|
case "MapCompare":
|
||||||
|
valueToSet = "MAP";
|
||||||
|
break;
|
||||||
case "CompareDashboard":
|
case "CompareDashboard":
|
||||||
valueToSet = "DASHBOARD";
|
valueToSet = "PERFORMANCE";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
* Maps a raw route page name to a unified uppercase display name.
|
* Maps a raw route page name to a unified uppercase display name.
|
||||||
*
|
*
|
||||||
* Converts "Check"-prefixed route names (e.g. "CheckMap") to their
|
* Converts "Check"-prefixed route names (e.g. "CheckMap") to their
|
||||||
* base names (e.g. "MAP"), and "CompareDashboard" to "DASHBOARD".
|
* base names (e.g. "MAP"), and "CompareDashboard" to "PERFORMANCE"
|
||||||
|
* to match the compare navbar tab label.
|
||||||
* All other names are simply uppercased.
|
* All other names are simply uppercased.
|
||||||
*
|
*
|
||||||
* @param {string} rawPageName - The raw route name to convert.
|
* @param {string} rawPageName - The raw route name to convert.
|
||||||
@@ -27,7 +28,7 @@ const mapPageNameToCapitalUnifiedName = (rawPageName) => {
|
|||||||
case "CHECKPERFORMANCE":
|
case "CHECKPERFORMANCE":
|
||||||
return "PERFORMANCE";
|
return "PERFORMANCE";
|
||||||
case "COMPAREDASHBOARD":
|
case "COMPAREDASHBOARD":
|
||||||
return "DASHBOARD";
|
return "PERFORMANCE";
|
||||||
default:
|
default:
|
||||||
return rawPageName.toUpperCase();
|
return rawPageName.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ describe("pageAdminStore", () => {
|
|||||||
expect(store.pendingActivePage).toBe("MAP");
|
expect(store.pendingActivePage).toBe("MAP");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("setPendingActivePage maps CompareDashboard to PERFORMANCE", () => {
|
||||||
|
store.setPendingActivePage("CompareDashboard");
|
||||||
|
expect(store.pendingActivePage).toBe("PERFORMANCE");
|
||||||
|
});
|
||||||
|
|
||||||
it("copyPendingPageToActivePage transfers value", () => {
|
it("copyPendingPageToActivePage transfers value", () => {
|
||||||
store.setPendingActivePage("CheckConformance");
|
store.setPendingActivePage("CheckConformance");
|
||||||
store.copyPendingPageToActivePage();
|
store.copyPendingPageToActivePage();
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ describe("pageUtils", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("converts CompareDashboard to DASHBOARD", () => {
|
it("converts CompareDashboard to PERFORMANCE", () => {
|
||||||
expect(mapPageNameToCapitalUnifiedName("CompareDashboard")).toBe(
|
expect(mapPageNameToCapitalUnifiedName("CompareDashboard")).toBe(
|
||||||
"DASHBOARD",
|
"PERFORMANCE",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user