Skip to content

Commit 875fb0d

Browse files
committed
fix: enable and update e2e tests
- Update SSO login dialog regex to match latest. - Update test util to accept 'test' propert of Mocha Context.
1 parent 75da796 commit 875fb0d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/test/setupUtil.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getLogger } from '../shared/logger'
1010
import { hasKey } from '../shared/utilities/tsUtils'
1111
import { getTestWindow, printPendingUiElements } from './shared/vscode/window'
1212
import { ToolkitError, formatError } from '../shared/errors'
13+
import { proceedToBrowser } from '../auth/sso/model'
1314

1415
const runnableTimeout = Symbol('runnableTimeout')
1516

@@ -56,8 +57,14 @@ export function setRunnableTimeout(test: Mocha.Runnable, maxTestDuration: number
5657
}
5758

5859
export function skipTest(testOrCtx: Mocha.Context | Mocha.Test | undefined, reason?: string) {
59-
const test =
60-
testOrCtx?.type === 'test' ? (testOrCtx as Mocha.Test) : (testOrCtx as Mocha.Context | undefined)?.currentTest
60+
let test
61+
62+
if (testOrCtx?.type === 'test') {
63+
test = (testOrCtx as Mocha.Test)
64+
} else {
65+
const context = (testOrCtx as Mocha.Context | undefined)
66+
test = context?.currentTest ?? context?.test
67+
}
6168

6269
if (test) {
6370
test.title += ` (skipped${reason ? ` - ${reason}` : ''})`
@@ -203,7 +210,7 @@ function maskArns(text: string) {
203210
*/
204211
export function registerAuthHook(secret: string, lambdaId = process.env['AUTH_UTIL_LAMBDA_ARN']) {
205212
return getTestWindow().onDidShowMessage(message => {
206-
if (message.items[0].title.match(/Copy Code/)) {
213+
if (message.items[0].title.match(new RegExp(proceedToBrowser))) {
207214
if (!lambdaId) {
208215
const baseMessage = 'Browser login flow was shown during testing without an authorizer function'
209216
if (process.env['AWS_TOOLKIT_AUTOMATION'] === 'local') {

src/testE2E/codecatalyst/client.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let projectName: CodeCatalystProject['name']
8686
* integ tests, but using the ssh hostname that we get from
8787
* {@link prepareDevEnvConnection}.
8888
*/
89-
describe.skip('Test how this codebase uses the CodeCatalyst API', function () {
89+
describe('Test how this codebase uses the CodeCatalyst API', function () {
9090
let client: CodeCatalystClient
9191
let commands: CodeCatalystCommands
9292
let webviewClient: CodeCatalystCreateWebview

0 commit comments

Comments
 (0)