1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-04 01:18:20 +02:00

fix: tag validation duplicate message (#1756)

This commit is contained in:
Tymoteusz Czech 2022-06-28 08:04:43 +02:00 committed by GitHub
parent e0557a6e5d
commit f96b4525a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class FeatureTagStore implements IFeatureTagStore {
.catch((err) => { .catch((err) => {
if (err.code === UNIQUE_CONSTRAINT_VIOLATION) { if (err.code === UNIQUE_CONSTRAINT_VIOLATION) {
throw new FeatureHasTagError( throw new FeatureHasTagError(
`${featureName} already had the tag: [${tag.type}:${tag.value}]`, `${featureName} already has the tag: [${tag.type}:${tag.value}]`,
); );
} else { } else {
throw err; throw err;

View File

@ -748,7 +748,7 @@ test('Tagging a feature with a tag it already has should return 409', async () =
.expect(409) .expect(409)
.expect((res) => { .expect((res) => {
expect(res.body.details[0].message).toBe( expect(res.body.details[0].message).toBe(
`${feature1Name} already had the tag: [${tag.type}:${tag.value}]`, `${feature1Name} already has the tag: [${tag.type}:${tag.value}]`,
); );
}); });
}); });

View File

@ -77,7 +77,7 @@ test('should throw if feature have tag', async () => {
try { try {
await featureTagStore.tagFeature(featureName, tag); await featureTagStore.tagFeature(featureName, tag);
} catch (e) { } catch (e) {
expect(e.message).toContain('already had the tag'); expect(e.message).toContain('already has the tag');
} }
}); });