File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed
e2e/__tests__/app-impress
impress/src/features/docs/doc-management/components Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -75,15 +75,15 @@ test.describe('Doc Header', () => {
7575 // Check the tree
7676 const docTree = page . getByTestId ( 'doc-tree' ) ;
7777 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 ( ) ;
78+ await expect ( docTree . getByTestId ( 'doc- emoji- icon') ) . toBeVisible ( ) ;
79+ await expect ( docTree . getByTestId ( 'doc-simple- icon') ) . toBeHidden ( ) ;
8080
8181 await page . getByTestId ( 'home-button' ) . click ( ) ;
8282
8383 // Check the documents grid
8484 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 ( ) ;
85+ await expect ( gridRow . getByTestId ( 'doc- emoji- icon') ) . toBeVisible ( ) ;
86+ await expect ( gridRow . getByTestId ( 'doc-simple- icon') ) . toBeHidden ( ) ;
8787 } ) ;
8888
8989 test ( 'it deletes the doc' , async ( { page, browserName } ) => {
Original file line number Diff line number Diff line change 1- import { useTranslation } from 'react-i18next' ;
2-
31import { Text , TextType } from '@/components' ;
42
53type DocIconProps = TextType & {
@@ -15,8 +13,6 @@ export const DocIcon = ({
1513 $weight = '400' ,
1614 ...textProps
1715} : DocIconProps ) => {
18- const { t } = useTranslation ( ) ;
19-
2016 if ( ! emoji ) {
2117 return < > { defaultIcon } </ > ;
2218 }
@@ -28,7 +24,7 @@ export const DocIcon = ({
2824 $variation = { $variation }
2925 $weight = { $weight }
3026 aria-hidden = "true"
31- aria-label = { t ( 'Document emoji icon' ) }
27+ data-testid = "doc- emoji- icon"
3228 >
3329 { emoji }
3430 </ Text >
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export const SimpleDocItem = ({
6666 { isPinned ? (
6767 < PinnedDocumentIcon
6868 aria-hidden = "true"
69- aria-label = { t ( 'Pin document icon' ) }
69+ data-testid = "doc-pinned- icon"
7070 color = { colorsTokens [ 'primary-500' ] }
7171 />
7272 ) : (
@@ -75,7 +75,7 @@ export const SimpleDocItem = ({
7575 defaultIcon = {
7676 < SimpleFileIcon
7777 aria-hidden = "true"
78- aria-label = { t ( 'Simple document icon' ) }
78+ data-testid = "doc-simple- icon"
7979 color = { colorsTokens [ 'primary-500' ] }
8080 />
8181 }
You can’t perform that action at this time.
0 commit comments