Skip to content

Commit f8b959d

Browse files
imsinghtoddbaert
andauthored
chore: enable metadata tests for flagd #1290 (#1431)
Signed-off-by: Indermohan Singh <indermohansinghk7@gmail.com> Signed-off-by: Todd Baert <todd.baert@dynatrace.com> Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
1 parent 23a2363 commit f8b959d

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

libs/providers/flagd/src/e2e/step-definitions/flagSteps.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ export const flagSteps: Steps =
7373
});
7474

7575
then('the resolved metadata should contain', (table) => {
76-
// TODO: implement metadata tests, https://github.com/open-feature/js-sdk-contrib/issues/1290
76+
table.forEach((row: { key: string; metadata_type: string; value: string }) => {
77+
const expectedValue = mapValueToType(row.value, row.metadata_type);
78+
expect(state.details?.flagMetadata).toHaveProperty(row.key, expectedValue);
79+
});
7780
});
7881

7982
then('the resolved metadata is empty', () => {
80-
// TODO: implement metadata tests, https://github.com/open-feature/js-sdk-contrib/issues/1290
83+
expect(state.details?.flagMetadata).toEqual({});
8184
});
8285
};

libs/providers/flagd/src/e2e/step-definitions/providerSteps.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ export const providerSteps: Steps =
7373
flagdOptions['port'] = container.getPort(state.resolverType);
7474
type = 'sync-payload';
7575
break;
76+
case 'metadata':
77+
flagdOptions['port'] = container.getPort(state.resolverType);
78+
type = 'metadata';
79+
break;
7680
default:
7781
throw new Error('unknown provider type: ' + providerType);
7882
}

libs/providers/flagd/src/e2e/tests/in-process.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('in-process', () => {
2323
loadFeatures(GHERKIN_FLAGD, {
2424
// remove filters as we add support for features
2525
// see: https://github.com/open-feature/js-sdk-contrib/issues/1096 and child issues
26-
tagFilter: '@in-process and not @targetURI and not @sync and not @metadata and not @unixsocket',
26+
tagFilter: '@in-process and not @targetURI and not @sync and not @unixsocket',
2727
scenarioNameTemplate: (vars) => {
2828
return `${vars.scenarioTitle} (${vars.scenarioTags.join(',')} ${vars.featureTags.join(',')})`;
2929
},

libs/providers/flagd/src/e2e/tests/rpc.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('rpc', () => {
2424
tagFilter:
2525
// remove filters as we add support for features
2626
// see: https://github.com/open-feature/js-sdk-contrib/issues/1096 and child issues
27-
'@rpc and not @targetURI and not @metadata and not @caching and not @unixsocket',
27+
'@rpc and not @targetURI and not @caching and not @unixsocket',
2828
scenarioNameTemplate: (vars) => {
2929
return `${vars.scenarioTitle} (${vars.scenarioTags.join(',')} ${vars.featureTags.join(',')})`;
3030
},

0 commit comments

Comments
 (0)