File tree Expand file tree Collapse file tree 5 files changed +15
-14
lines changed
e2e/__tests__/app-impress Expand file tree Collapse file tree 5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ test.describe('Doc Create', () => {
50
50
waitUntil : 'domcontentloaded' ,
51
51
} ) ;
52
52
53
- const input = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
54
- await expect ( input ) . toHaveText ( / ^ (?: U n t i t l e d d o c u m e n t ) ? $ / ) ;
53
+ const input = page . getByRole ( 'textbox' , { name : ' Document title' } ) ;
54
+ await expect ( input ) . toHaveText ( '' ) ;
55
55
await expect (
56
56
page . locator ( '.c__tree-view--row-content' ) . getByText ( 'Untitled document' ) ,
57
57
) . toBeVisible ( ) ;
@@ -77,8 +77,8 @@ test.describe('Doc Create', () => {
77
77
waitUntil : 'domcontentloaded' ,
78
78
} ) ;
79
79
80
- const input = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
81
- await expect ( input ) . toHaveText ( / ^ (?: U n t i t l e d d o c u m e n t ) ? $ / ) ;
80
+ const input = page . getByRole ( 'textbox' , { name : ' Document title' } ) ;
81
+ await expect ( input ) . toHaveText ( '' ) ;
82
82
await expect (
83
83
page . locator ( '.c__tree-view--row-content' ) . getByText ( 'Untitled document' ) ,
84
84
) . toBeVisible ( ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ test.describe('Doc Header', () => {
25
25
'It is the card information about the document.' ,
26
26
) ;
27
27
28
- const docTitle = card . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
28
+ const docTitle = card . getByRole ( 'textbox' , { name : ' Document title' } ) ;
29
29
await expect ( docTitle ) . toBeVisible ( ) ;
30
30
31
31
await page . getByRole ( 'button' , { name : 'Share' } ) . click ( ) ;
@@ -52,7 +52,7 @@ test.describe('Doc Header', () => {
52
52
53
53
test ( 'it updates the title doc' , async ( { page, browserName } ) => {
54
54
await createDoc ( page , 'doc-update' , browserName , 1 ) ;
55
- const docTitle = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
55
+ const docTitle = page . getByRole ( 'textbox' , { name : ' Document title' } ) ;
56
56
await expect ( docTitle ) . toBeVisible ( ) ;
57
57
await docTitle . fill ( 'Hello World' ) ;
58
58
await docTitle . blur ( ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ test.describe('Doc Tree', () => {
51
51
await expect ( subPageItem ) . toBeVisible ( ) ;
52
52
await subPageItem . click ( ) ;
53
53
await verifyDocName ( page , '' ) ;
54
- const input = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
54
+ const input = page . getByRole ( 'textbox' , { name : ' Document title' } ) ;
55
55
await input . click ( ) ;
56
56
const [ randomDocName ] = randomName ( 'doc-tree-test' , browserName , 1 ) ;
57
57
await input . fill ( randomDocName ) ;
@@ -197,7 +197,7 @@ test.describe('Doc Tree', () => {
197
197
await page . getByText ( 'Move to my docs' ) . click ( ) ;
198
198
199
199
await expect (
200
- page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ,
200
+ page . getByRole ( 'textbox' , { name : ' Document title' } ) ,
201
201
) . not . toHaveText ( docChild ) ;
202
202
203
203
const header = page . locator ( 'header' ) . first ( ) ;
Original file line number Diff line number Diff line change @@ -101,9 +101,9 @@ export const createDoc = async (
101
101
waitUntil : 'networkidle' ,
102
102
} ) ;
103
103
104
- const input = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
104
+ const input = page . getByLabel ( ' Document title' ) ;
105
105
await expect ( input ) . toBeVisible ( ) ;
106
- await input . click ( ) ;
106
+ await expect ( input ) . toHaveText ( '' ) ;
107
107
108
108
await input . fill ( randomDocs [ i ] ) ;
109
109
await input . blur ( ) ;
@@ -121,7 +121,7 @@ export const verifyDocName = async (page: Page, docName: string) => {
121
121
122
122
try {
123
123
await expect (
124
- page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ,
124
+ page . getByRole ( 'textbox' , { name : ' Document title' } ) ,
125
125
) . toHaveText ( docName ) ;
126
126
} catch {
127
127
await expect ( page . getByRole ( 'heading' , { name : docName } ) ) . toBeVisible ( ) ;
@@ -179,7 +179,8 @@ export const goToGridDoc = async (
179
179
} ;
180
180
181
181
export const updateDocTitle = async ( page : Page , title : string ) => {
182
- const input = page . getByRole ( 'textbox' , { name : / ^ D o c u m e n t t i t l e / i } ) ;
182
+ const input = page . getByRole ( 'textbox' , { name : 'Document title' } ) ;
183
+ await expect ( input ) . toHaveText ( '' ) ;
183
184
await expect ( input ) . toBeVisible ( ) ;
184
185
await input . click ( ) ;
185
186
await input . fill ( title ) ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
116
116
defaultValue = { titleDisplay || undefined }
117
117
onKeyDownCapture = { handleKeyDown }
118
118
suppressContentEditableWarning = { true }
119
- aria-label = { `${ t ( 'Document title' ) } ${ doc . title || untitledDocument } ` }
119
+ aria-label = { `${ t ( 'Document title' ) } ` }
120
120
aria-multiline = { false }
121
121
onBlurCapture = { ( event ) =>
122
122
handleTitleSubmit ( event . target . textContent || '' )
@@ -138,7 +138,7 @@ const DocTitleInput = ({ doc }: DocTitleProps) => {
138
138
outline : none;
139
139
` }
140
140
>
141
- { titleDisplay || untitledDocument }
141
+ { titleDisplay }
142
142
</ Box >
143
143
</ Tooltip >
144
144
) ;
You can’t perform that action at this time.
0 commit comments