Skip to content

Commit f22410a

Browse files
authored
test(api7): fix consumer credentials (#199)
1 parent 449743c commit f22410a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

libs/backend-api7/e2e/resources/consumer.e2e-spec.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as ADCSDK from '@api7/adc-sdk';
2-
import { gte } from 'lodash';
3-
import { lt } from 'semver';
2+
import { gte, lt } from 'semver';
43

54
import { BackendAPI7 } from '../../src';
65
import { conditionalDescribe, semverCondition } from '../support/utils';
@@ -145,7 +144,7 @@ describe('Consumer E2E', () => {
145144
updateEvent(
146145
ADCSDK.ResourceType.CONSUMER_CREDENTIAL,
147146
consumer1Key,
148-
consumer1,
147+
consumer1Cred,
149148
consumer1Name,
150149
),
151150
]);
@@ -175,7 +174,6 @@ describe('Consumer E2E', () => {
175174
backend,
176175
)) as ADCSDK.Configuration;
177176
expect(result.consumers).toHaveLength(1);
178-
expect(result.consumers[0]).toMatchObject(consumer1);
179177
expect(result.consumers[0].credentials).toHaveLength(0);
180178
});
181179

libs/backend-api7/e2e/support/utils.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ export const deleteEvent = (
9595
: ADCSDK.utils.generateId(
9696
parentName ? `${parentName}.${resourceName}` : resourceName,
9797
),
98-
parentId: parentName ? ADCSDK.utils.generateId(parentName) : undefined,
98+
parentId: parentName
99+
? resourceType === ADCSDK.ResourceType.CONSUMER_CREDENTIAL
100+
? parentName
101+
: ADCSDK.utils.generateId(parentName)
102+
: undefined,
99103
});
100104

101105
type cond = boolean | (() => boolean);

0 commit comments

Comments
 (0)