Skip to content

Commit 97eb9cd

Browse files
committed
fix(test): update integration tests for credential rename and alias removal
Integration tests were still using `add identity` and `remove identity` commands which no longer exist without the backward-compat aliases. Confidence: high Scope-risk: narrow
1 parent 11dfe66 commit 97eb9cd

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

integ-tests/add-remove-gateway.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('integration: add and remove gateway with OpenAPI schema target', () =>
117117

118118
it('creates an API key credential for outbound auth', async () => {
119119
const result = await runCLI(
120-
['add', 'identity', '--name', 'TestApiKey', '--api-key', 'test-key-123', '--json'],
120+
['add', 'credential', '--name', 'TestApiKey', '--api-key', 'test-key-123', '--json'],
121121
project.projectPath
122122
);
123123
expect(result.exitCode, `stdout: ${result.stdout}, stderr: ${result.stderr}`).toBe(0);
@@ -238,7 +238,7 @@ describe('integration: add gateway with S3 URI schema target', () => {
238238
expect(result.exitCode, `stdout: ${result.stdout}, stderr: ${result.stderr}`).toBe(0);
239239

240240
const credResult = await runCLI(
241-
['add', 'identity', '--name', 'S3ApiKey', '--api-key', 'test-key', '--json'],
241+
['add', 'credential', '--name', 'S3ApiKey', '--api-key', 'test-key', '--json'],
242242
project.projectPath
243243
);
244244
expect(credResult.exitCode, `stdout: ${credResult.stdout}, stderr: ${credResult.stderr}`).toBe(0);
@@ -304,7 +304,10 @@ describe('integration: add gateway with S3 URI and bucketOwnerAccountId', () =>
304304

305305
it('adds a gateway and target with --schema-s3-account', async () => {
306306
await runCLI(['add', 'gateway', '--name', gatewayName, '--json'], project.projectPath);
307-
await runCLI(['add', 'identity', '--name', 'CrossApiKey', '--api-key', 'test-key', '--json'], project.projectPath);
307+
await runCLI(
308+
['add', 'credential', '--name', 'CrossApiKey', '--api-key', 'test-key', '--json'],
309+
project.projectPath
310+
);
308311

309312
const result = await runCLI(
310313
[

integ-tests/add-remove-resources.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ describe('integration: add and remove resources', () => {
8080
});
8181
});
8282

83-
describe('identity lifecycle', () => {
84-
const identityName = `IntegId${Date.now().toString().slice(-6)}`;
83+
describe('credential lifecycle', () => {
84+
const credentialName = `IntegId${Date.now().toString().slice(-6)}`;
8585

86-
it('adds an identity resource', async () => {
86+
it('adds a credential resource', async () => {
8787
const result = await runCLI(
88-
['add', 'identity', '--name', identityName, '--api-key', 'test-key-integ-123', '--json'],
88+
['add', 'credential', '--name', credentialName, '--api-key', 'test-key-integ-123', '--json'],
8989
project.projectPath
9090
);
9191

@@ -97,12 +97,12 @@ describe('integration: add and remove resources', () => {
9797
const config = await readProjectConfig(project.projectPath);
9898
const credentials = config.credentials as Record<string, unknown>[] | undefined;
9999
expect(credentials, 'credentials should exist').toBeDefined();
100-
const found = credentials!.some((c: Record<string, unknown>) => c.name === identityName);
101-
expect(found, `Identity "${identityName}" should be in config`).toBe(true);
100+
const found = credentials!.some((c: Record<string, unknown>) => c.name === credentialName);
101+
expect(found, `Credential "${credentialName}" should be in config`).toBe(true);
102102
});
103103

104-
it('removes the identity resource', async () => {
105-
const result = await runCLI(['remove', 'identity', '--name', identityName, '--json'], project.projectPath);
104+
it('removes the credential resource', async () => {
105+
const result = await runCLI(['remove', 'credential', '--name', credentialName, '--json'], project.projectPath);
106106

107107
expect(result.exitCode, `stdout: ${result.stdout}, stderr: ${result.stderr}`).toBe(0);
108108
const json = JSON.parse(result.stdout);
@@ -111,8 +111,8 @@ describe('integration: add and remove resources', () => {
111111
// Verify config updated
112112
const config = await readProjectConfig(project.projectPath);
113113
const credentials = (config.credentials as Record<string, unknown>[] | undefined) ?? [];
114-
const found = credentials.some((c: Record<string, unknown>) => c.name === identityName);
115-
expect(found, `Identity "${identityName}" should be removed from config`).toBe(false);
114+
const found = credentials.some((c: Record<string, unknown>) => c.name === credentialName);
115+
expect(found, `Credential "${credentialName}" should be removed from config`).toBe(false);
116116
});
117117
});
118118
});

0 commit comments

Comments
 (0)