Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rename thumb page #580

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Changes from all commits
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
34 changes: 34 additions & 0 deletions e2e/inline-edit/rename-thumb-page.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { test, expect } from '@playwright/test';

test('rename-thumb-page-through-direct-edit-and-context-menu', async ({
page,
}) => {
await page.goto('');

await page.getByText('Pages').click();
const thumb = page.getByText('Page 1', { exact: true });
await expect(thumb).toBeVisible();
await expect(thumb).toHaveText('Page 1');

await thumb.dblclick();
const input = page.getByRole('textbox');
const newTextContent = 'Change the name';
await input.fill(newTextContent);
await page.keyboard.press('Enter');
const renamedPage = page.getByText(newTextContent, { exact: true });
await expect(renamedPage).toBeVisible();

const siblingElement = page.getByText('Change the name', { exact: true });
const divThumb = siblingElement.locator('..');
await divThumb.click({ button: 'right' });
await page.getByText('Rename').click();

const secondNewTextContent = 'Other name';
await expect(input).toBeVisible();
await input.fill(secondNewTextContent);
await page.keyboard.press('Enter');
const secondRenamedPage = page.getByText(secondNewTextContent, {
exact: true,
});
await expect(secondRenamedPage).toBeVisible();
});