Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/static/js/pad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ const getParameters = [
$('#editbar').css('display', 'flex');
},
},
{
name: 'showMenuRight',
checkVal: 'false',
callback: (val) => {
$('#editbar .menu_right').hide();
},
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
},
{
name: 'showChat',
checkVal: null,
Expand Down
26 changes: 26 additions & 0 deletions src/tests/frontend-new/specs/hide_menu_right.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {expect, test} from "@playwright/test";
import {appendQueryParams, goToNewPad} from "../helper/padHelper";

test.beforeEach(async ({page, browser}) => {
const context = await browser.newContext();
await context.clearCookies();
await goToNewPad(page);
});

test.describe('showMenuRight URL parameter', function () {
test('without the parameter, .menu_right is visible', async function ({page}) {
await expect(page.locator('#editbar .menu_right')).toBeVisible();
});

test('showMenuRight=false hides .menu_right', async function ({page}) {
await appendQueryParams(page, {showMenuRight: 'false'});
await expect(page.locator('#editbar .menu_right')).toBeHidden();
// The left menu stays visible so the pad remains navigable.
await expect(page.locator('#editbar .menu_left')).toBeVisible();
});

test('showMenuRight with any other value leaves .menu_right visible', async function ({page}) {
await appendQueryParams(page, {showMenuRight: 'true'});
await expect(page.locator('#editbar .menu_right')).toBeVisible();
});
});
Loading