Skip to content

Commit 28701ac

Browse files
committed
Move AmazonQ backend test to AmazonQ package
1 parent 93ce28d commit 28701ac

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

packages/core/src/test/login/webview/vue/backend_amazonq.test.ts renamed to packages/amazonq/test/unit/amazonq/backend_amazonq.test.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@
44
*/
55

66
import assert from 'assert'
7-
import { AmazonQLoginWebview } from '../../../../login/webview/vue/amazonq/backend_amazonq'
8-
import { AuthUtil } from '../../../../codewhisperer/util/authUtil'
97
import * as sinon from 'sinon'
10-
import { assertTelemetry } from '../../../testUtil'
11-
import { connectToEnterpriseSso } from '../../../../codewhisperer/util/getStartUrl'
12-
import { awsIdSignIn } from '../../../../codewhisperer/util/showSsoPrompt'
13-
import { createTestAuthUtil } from '../../../testAuthUtil'
8+
import { assertTelemetry, createTestAuthUtil } from 'aws-core-vscode/test'
9+
import { AuthUtil, awsIdSignIn, getStartUrl } from 'aws-core-vscode/codewhisperer'
10+
import { backendAmazonQ } from 'aws-core-vscode/login'
1411

1512
describe('Amazon Q Login', async function () {
1613
const region = 'fakeRegion'
1714
const startUrl = 'fakeUrl'
1815

1916
let sandbox: sinon.SinonSandbox
20-
let backend: AmazonQLoginWebview
17+
let backend: backendAmazonQ.AmazonQLoginWebview
2118

22-
beforeEach(async function () {
23-
await createTestAuthUtil()
19+
await createTestAuthUtil()
2420

21+
beforeEach(function () {
2522
sandbox = sinon.createSandbox()
26-
backend = new AmazonQLoginWebview()
23+
backend = new backendAmazonQ.AmazonQLoginWebview()
2724
})
2825

2926
afterEach(function () {
@@ -85,7 +82,7 @@ describe('Amazon Q Login', async function () {
8582
})
8683

8784
it('reauths IdC and emits telemetry', async function () {
88-
await connectToEnterpriseSso(startUrl, region)
85+
await getStartUrl.connectToEnterpriseSso(startUrl, region)
8986

9087
await backend.reauthenticateConnection()
9188

packages/core/src/codewhisperer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export * from './util/commonUtil'
9393
export * from './util/supplementalContext/codeParsingUtil'
9494
export * from './util/supplementalContext/supplementalContextUtil'
9595
export * from './util/codewhispererSettings'
96+
export * as getStartUrl from './util/getStartUrl'
9697
export * as supplementalContextUtil from './util/supplementalContext/supplementalContextUtil'
9798
export * from './service/diagnosticsProvider'
9899
export * as diagnosticsProvider from './service/diagnosticsProvider'

packages/core/src/login/webview/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
export { CommonAuthViewProvider } from './commonAuthViewProvider'
77
export { CommonAuthWebview } from './vue/backend'
8+
export * as backendAmazonQ from './vue/amazonq/backend_amazonq'

0 commit comments

Comments
 (0)