File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,26 @@ describe("SuperTokens Webauthn SignIn", () => {
136136 localStorage . removeItem ( "webauthnErrorStatus" ) ;
137137 } ) ;
138138 } ) ;
139+ it ( "should show error if invalid options error is thrown" , async ( ) => {
140+ // Set the error to be thrown
141+ await page . evaluateOnNewDocument ( ( ) => {
142+ localStorage . setItem ( "webauthnErrorStatus" , "INVALID_OPTIONS_ERROR" ) ;
143+ } ) ;
144+ await tryWebauthnSignIn ( page ) ;
145+ const errorTextContainer = await waitForSTElement (
146+ page ,
147+ "[data-supertokens~='passkeyRecoverableErrorContainer']"
148+ ) ;
149+ const errorText = await errorTextContainer . evaluate ( ( el ) => el . textContent ) ;
150+ assert . strictEqual (
151+ errorText ,
152+ "The request either timed out, was canceled or the device is already registered. Please try again or try using another device."
153+ ) ;
154+
155+ await page . evaluateOnNewDocument ( ( ) => {
156+ localStorage . removeItem ( "webauthnErrorStatus" ) ;
157+ } ) ;
158+ } ) ;
139159 it ( "should show general error in the same view" , async ( ) => {
140160 // Set the error to be thrown
141161 await page . evaluateOnNewDocument ( ( ) => {
You can’t perform that action at this time.
0 commit comments