Skip to content

Commit

Permalink
chore: test that the tags API still returns tags that you can't creat…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
thomasheartman authored Jun 6, 2024
1 parent 6b4d9d0 commit eb39a21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/e2e/api/admin/tags.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

0 comments on commit eb39a21

Please sign in to comment.