@@ -9,80 +9,81 @@ import { CancellationError } from '../../../../shared/utilities/timeoutUtils'
99import { TelemetryMetadata } from '../../../../login/webview/vue/types'
1010
1111// TODO: remove auth page and tests
12- describe ( 'Amazon Q Login' , function ( ) {
13- const region = 'fakeRegion'
14- const startUrl = 'fakeUrl'
12+ for ( const _ of Array . from ( { length : 1000 } , i => i ) ) {
13+ describe ( 'Amazon Q Login' , function ( ) {
14+ const region = 'fakeRegion'
15+ const startUrl = 'fakeUrl'
1516
16- let backend : AmazonQLoginWebview
17+ let backend : AmazonQLoginWebview
1718
18- beforeEach ( function ( ) {
19- backend = new AmazonQLoginWebview ( )
20- } )
19+ beforeEach ( function ( ) {
20+ backend = new AmazonQLoginWebview ( )
21+ } )
2122
22- it ( 'emits ui_click telemetry' , function ( ) {
23- backend . emitUiClick ( 'auth_backButton' )
23+ it ( 'emits ui_click telemetry' , function ( ) {
24+ backend . emitUiClick ( 'auth_backButton' )
2425
25- assertTelemetry ( 'ui_click' , {
26- elementId : 'auth_backButton' ,
26+ assertTelemetry ( 'ui_click' , {
27+ elementId : 'auth_backButton' ,
28+ } )
2729 } )
28- } )
2930
30- it ( 'runs setup and emits success and recorded metrics' , async function ( ) {
31- const metadata : TelemetryMetadata = {
32- credentialSourceId : 'iamIdentityCenter' ,
33- credentialStartUrl : startUrl ,
34- awsRegion : region ,
35- }
36- const setupFunc = async ( ) => {
37- backend . storeMetricMetadata ( metadata )
38- }
31+ it ( 'runs setup and emits success and recorded metrics' , async function ( ) {
32+ const metadata : TelemetryMetadata = {
33+ credentialSourceId : 'iamIdentityCenter' ,
34+ credentialStartUrl : startUrl ,
35+ awsRegion : region ,
36+ }
37+ const setupFunc = async ( ) => {
38+ backend . storeMetricMetadata ( metadata )
39+ }
3940
40- // method under test
41- await backend . ssoSetup ( 'test' , setupFunc , true )
41+ // method under test
42+ await backend . ssoSetup ( 'test' , setupFunc , true )
4243
43- assertTelemetry ( 'auth_addConnection' , {
44- result : 'Succeeded' ,
45- ...metadata ,
44+ assertTelemetry ( 'auth_addConnection' , {
45+ result : 'Succeeded' ,
46+ ...metadata ,
47+ } )
4648 } )
47- } )
48-
49- it ( 'runs setup and emits failed and recorded metrics' , async function ( ) {
50- const metadata : TelemetryMetadata = {
51- credentialSourceId : 'iamIdentityCenter' ,
52- credentialStartUrl : startUrl ,
53- awsRegion : region ,
54- }
55- const setupFunc = async ( ) => {
56- backend . storeMetricMetadata ( metadata )
57- throw new Error ( 'error' )
58- }
49+ it ( 'runs setup and emits failed and recorded metrics' , async function ( ) {
50+ const metadata : TelemetryMetadata = {
51+ credentialSourceId : 'iamIdentityCenter' ,
52+ credentialStartUrl : startUrl ,
53+ awsRegion : region ,
54+ }
55+ const setupFunc = async ( ) => {
56+ backend . storeMetricMetadata ( metadata )
57+ throw new Error ( 'error' )
58+ }
5959
60- // method under test
61- await backend . ssoSetup ( 'test' , setupFunc , true )
60+ // method under test
61+ await backend . ssoSetup ( 'test' , setupFunc , true )
6262
63- assertTelemetry ( 'auth_addConnection' , {
64- result : 'Failed' ,
65- ...metadata ,
63+ assertTelemetry ( 'auth_addConnection' , {
64+ result : 'Failed' ,
65+ ...metadata ,
66+ } )
6667 } )
67- } )
6868
69- it ( 'runs setup and emits cancelled and recorded metrics' , async function ( ) {
70- const metadata : TelemetryMetadata = {
71- credentialSourceId : 'iamIdentityCenter' ,
72- credentialStartUrl : startUrl ,
73- awsRegion : region ,
74- }
75- const setupFunc = async ( ) => {
76- backend . storeMetricMetadata ( metadata )
77- throw new CancellationError ( 'user' )
78- }
69+ it ( 'runs setup and emits cancelled and recorded metrics' , async function ( ) {
70+ const metadata : TelemetryMetadata = {
71+ credentialSourceId : 'iamIdentityCenter' ,
72+ credentialStartUrl : startUrl ,
73+ awsRegion : region ,
74+ }
75+ const setupFunc = async ( ) => {
76+ backend . storeMetricMetadata ( metadata )
77+ throw new CancellationError ( 'user' )
78+ }
7979
80- // method under test
81- await backend . ssoSetup ( 'test' , setupFunc , true )
80+ // method under test
81+ await backend . ssoSetup ( 'test' , setupFunc , true )
8282
83- assertTelemetry ( 'auth_addConnection' , {
84- result : 'Cancelled' ,
85- ...metadata ,
83+ assertTelemetry ( 'auth_addConnection' , {
84+ result : 'Cancelled' ,
85+ ...metadata ,
86+ } )
8687 } )
8788 } )
88- } )
89+ }
0 commit comments