1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: test that the tags API still returns tags that you can't create anymore (#7304)

This change adds a test to the tags API to ensure that even if you
can't create tags that are pure whitespace anymore, you'll still
receive pre-existing tags from the API that fit this description.

The test is here to ensure that we don't break this in future versions
of Unleash.
This commit is contained in:
Thomas Heartman 2024-06-06 14:16:45 +02:00 committed by GitHub
parent 6b4d9d0c1d
commit eb39a212ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,3 +209,10 @@ test('Can bulk remove tags', async () => {
})
.expect(200);
});
test('backward compatibility: the API should return invalid tag names if they exist', async () => {
const tag = { value: ' ', type: 'simple' };
await db.stores.tagStore.createTag(tag);
const { body } = await app.request.get('/api/admin/tags').expect(200);
expect(body.tags).toContainEqual(tag);
});