@@ -60,11 +60,13 @@ export const ShowsUpdateNotification: Story = {
6060 } ,
6161 play : async ( ) => {
6262 const body = within ( document . body ) ;
63- const snackbar = await body . findByTestId ( "update-check-snackbar" ) ;
64-
65- await waitFor ( ( ) => {
66- expect ( snackbar ) . toBeVisible ( ) ;
67- } ) ;
63+ await waitFor (
64+ ( ) => {
65+ const snackbar = body . getByTestId ( "update-check-snackbar" ) ;
66+ expect ( snackbar ) . toBeVisible ( ) ;
67+ } ,
68+ { timeout : 5000 } ,
69+ ) ;
6870 } ,
6971} ;
7072
@@ -74,20 +76,23 @@ export const SkipLinkPrecedesNavigation: Story = {
7476 const skipToContentLink = await canvas . findByRole ( "link" , {
7577 name : skipLinkName ,
7678 } ) ;
77- const [ navigation ] = await canvas . findAllByRole ( "navigation" ) ;
7879
79- await waitFor ( ( ) => {
80- expect ( document . getElementById ( "main-content" ) ) . not . toBeNull ( ) ;
81- } ) ;
82- const mainContent = getMainContent ( ) ;
80+ await waitFor (
81+ ( ) => {
82+ const mainContent = document . getElementById ( "main-content" ) ;
83+ expect ( mainContent ) . not . toBeNull ( ) ;
8384
84- expect ( skipToContentLink ) . toHaveTextContent ( skipLinkName ) ;
85- expect ( skipToContentLink ) . toHaveAttribute ( "href" , "#main-content" ) ;
86- expect ( mainContent ) . toHaveAttribute ( "tabindex" , "-1" ) ;
87- expect (
88- skipToContentLink . compareDocumentPosition ( navigation ) &
89- Node . DOCUMENT_POSITION_FOLLOWING ,
90- ) . toBeTruthy ( ) ;
85+ const [ navigation ] = canvas . getAllByRole ( "navigation" ) ;
86+ expect ( skipToContentLink ) . toHaveTextContent ( skipLinkName ) ;
87+ expect ( skipToContentLink ) . toHaveAttribute ( "href" , "#main-content" ) ;
88+ expect ( mainContent ) . toHaveAttribute ( "tabindex" , "-1" ) ;
89+ expect (
90+ skipToContentLink . compareDocumentPosition ( navigation ) &
91+ Node . DOCUMENT_POSITION_FOLLOWING ,
92+ ) . toBeTruthy ( ) ;
93+ } ,
94+ { timeout : 5000 } ,
95+ ) ;
9196 } ,
9297} ;
9398
@@ -106,8 +111,11 @@ export const SkipLinkMovesFocusToMainContent: Story = {
106111
107112 await user . click ( skipToContentLink ) ;
108113
109- await waitFor ( ( ) => {
110- expect ( mainContent ) . toHaveFocus ( ) ;
111- } ) ;
114+ await waitFor (
115+ ( ) => {
116+ expect ( mainContent ) . toHaveFocus ( ) ;
117+ } ,
118+ { timeout : 5000 } ,
119+ ) ;
112120 } ,
113121} ;
0 commit comments