diff --git a/tests/utils/collections/policyTags.ts b/tests/utils/collections/policyTags.ts index 6854c669a5b5..e76ba1eabf4d 100644 --- a/tests/utils/collections/policyTags.ts +++ b/tests/utils/collections/policyTags.ts @@ -4,7 +4,9 @@ import type {PolicyTagLists, PolicyTags} from '@src/types/onyx'; export default function createRandomPolicyTags(tagListName: string, numberOfTags = 0): PolicyTagLists { const tags: PolicyTags = {}; for (let i = 0; i < numberOfTags; i++) { - const tagName = randWord(); + // Prevent the tag name from being duplicated, which can happen when a lot of tests are being ran + // and can cause tests to fail because tag lists must always contain a unique set of tags + const tagName = `${randWord()}${i}`; tags[tagName] = { name: tagName, enabled: true,