mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
injecting localstorage values to hide usageIndicator, prompts, and new badges
This commit is contained in:
parent
d5824d871c
commit
0d6fcee23e
1 changed files with 12 additions and 0 deletions
|
|
@ -26,6 +26,11 @@ for (const { role, storage } of roles) {
|
|||
|
||||
test("should navigate to correct URL when clicking sidebar menu items from homepage", async ({ page }) => {
|
||||
await page.goto("/ui");
|
||||
await page.evaluate(() => {
|
||||
window.localStorage.setItem("disableUsageIndicator", "true");
|
||||
window.localStorage.setItem("disableShowPrompts", "true");
|
||||
window.localStorage.setItem("disableShowNewBadge", "true");
|
||||
});
|
||||
|
||||
for (const buttonLabel of sidebarButtons[role as keyof typeof sidebarButtons]) {
|
||||
const expectedPage = menuLabelToPage[buttonLabel];
|
||||
|
|
@ -45,6 +50,13 @@ for (const { role, storage } of roles) {
|
|||
});
|
||||
|
||||
test("should navigate directly to page using navigation helper", async ({ page }) => {
|
||||
await page.goto("/ui");
|
||||
await page.evaluate(() => {
|
||||
window.localStorage.setItem("disableUsageIndicator", "true");
|
||||
window.localStorage.setItem("disableShowPrompts", "true");
|
||||
window.localStorage.setItem("disableShowNewBadge", "true");
|
||||
});
|
||||
|
||||
// Test direct navigation to verify the helper function works
|
||||
await navigateToPage(page, Page.ApiKeys);
|
||||
await expect(page).toHaveURL(new RegExp(`[?&]page=${Page.ApiKeys}(&|$)`));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue