Skip to content

Commit 7f1e3f6

Browse files
committed
fixup! fixup! ✨(frontend) use title first emoji as doc icon in tree
1 parent 72ce96d commit 7f1e3f6

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

src/frontend/apps/e2e/__tests__/app-impress/doc-header.spec.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,22 @@ test.describe('Doc Header', () => {
6868
await createDoc(page, 'doc-update', browserName, 1);
6969
const docTitle = page.getByRole('textbox', { name: 'doc title input' });
7070
await expect(docTitle).toBeVisible();
71-
await docTitle.fill('👍 Hello World');
71+
await docTitle.fill('👍 Hello Emoji World');
7272
await docTitle.blur();
73-
await verifyDocName(page, '👍 Hello World');
73+
await verifyDocName(page, '👍 Hello Emoji World');
74+
75+
// Check the tree
76+
const docTree = page.getByTestId('doc-tree');
77+
await expect(docTree.getByText('Hello Emoji World')).toBeVisible();
78+
await expect(docTree.getByLabel('Document emoji icon')).toBeVisible();
79+
await expect(docTree.getByLabel('Simple document icon')).toBeHidden();
80+
81+
await page.getByTestId('home-button').click();
82+
83+
// Check the documents grid
84+
const gridRow = await getGridRow(page, 'Hello Emoji World');
85+
await expect(gridRow.getByLabel('Document emoji icon')).toBeVisible();
86+
await expect(gridRow.getByLabel('Simple document icon')).toBeHidden();
7487
});
7588

7689
test('it deletes the doc', async ({ page, browserName }) => {

src/frontend/apps/e2e/__tests__/app-impress/utils-common.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ export const getGridRow = async (page: Page, title: string) => {
136136

137137
const rows = docsGrid.getByRole('row');
138138

139-
const row = rows.filter({
140-
hasText: title,
141-
});
139+
const row = rows
140+
.filter({
141+
hasText: title,
142+
})
143+
.first();
142144

143145
await expect(row).toBeVisible();
144146

0 commit comments

Comments
 (0)