feat(core): use double click to activate title renaming (#4214)
This commit is contained in:
@@ -76,7 +76,7 @@ const StableTitle = ({
|
|||||||
<span
|
<span
|
||||||
data-testid="title-edit-button"
|
data-testid="title-edit-button"
|
||||||
className={styles.titleEditButton}
|
className={styles.titleEditButton}
|
||||||
onClick={onRename}
|
onDoubleClick={onRename}
|
||||||
>
|
>
|
||||||
{title || 'Untitled'}
|
{title || 'Untitled'}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ test('Able to insert the title of an untitled page', async ({ page }) => {
|
|||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
||||||
await titleBarTextContent.click({ delay: 100 });
|
await titleBarTextContent.dblclick({ delay: 100 });
|
||||||
const titleContent = await page.getByTestId('title-content');
|
const titleContent = await page.getByTestId('title-content');
|
||||||
await titleContent.fill('test');
|
await titleContent.fill('test');
|
||||||
await titleContent.blur();
|
await titleContent.blur();
|
||||||
@@ -78,12 +78,12 @@ test('Able to edit the title of an existing page', async ({ page }) => {
|
|||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
||||||
await titleBarTextContent.click({ delay: 100 });
|
await titleBarTextContent.dblclick({ delay: 100 });
|
||||||
const titleContent = await page.getByTestId('title-content');
|
const titleContent = await page.getByTestId('title-content');
|
||||||
await titleContent.fill('test');
|
await titleContent.fill('test');
|
||||||
await titleContent.blur();
|
await titleContent.blur();
|
||||||
expect(await titleBarTextContent.textContent()).toBe('test');
|
expect(await titleBarTextContent.textContent()).toBe('test');
|
||||||
await titleBarTextContent.click({ delay: 100 });
|
await titleBarTextContent.dblclick({ delay: 100 });
|
||||||
await titleContent.fill('Sample text 2');
|
await titleContent.fill('Sample text 2');
|
||||||
await titleContent.blur();
|
await titleContent.blur();
|
||||||
expect(await titleBarTextContent.textContent()).toBe('Sample text 2');
|
expect(await titleBarTextContent.textContent()).toBe('Sample text 2');
|
||||||
@@ -95,12 +95,12 @@ test('Clearing out the title bar will remove the page title', async ({
|
|||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
await waitForEditorLoad(page);
|
await waitForEditorLoad(page);
|
||||||
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
const titleBarTextContent = await page.getByTestId('title-edit-button');
|
||||||
await titleBarTextContent.click({ delay: 100 });
|
await titleBarTextContent.dblclick({ delay: 100 });
|
||||||
const titleContent = await page.getByTestId('title-content');
|
const titleContent = await page.getByTestId('title-content');
|
||||||
await titleContent.fill('test');
|
await titleContent.fill('test');
|
||||||
await titleContent.blur();
|
await titleContent.blur();
|
||||||
expect(await titleBarTextContent.textContent()).toBe('test');
|
expect(await titleBarTextContent.textContent()).toBe('test');
|
||||||
await titleBarTextContent.click({ delay: 100 });
|
await titleBarTextContent.dblclick({ delay: 100 });
|
||||||
await titleContent.fill('');
|
await titleContent.fill('');
|
||||||
await titleContent.blur();
|
await titleContent.blur();
|
||||||
expect(await titleBarTextContent.textContent()).toBe('Untitled');
|
expect(await titleBarTextContent.textContent()).toBe('Untitled');
|
||||||
|
|||||||
Reference in New Issue
Block a user