From bf56d3c5bb46c7ed9484f237cef77bcdd872df3c Mon Sep 17 00:00:00 2001 From: Nelson Kopliku Date: Fri, 16 Jun 2023 09:21:25 +0200 Subject: [PATCH] avoid duplicated expectation names from catalog factories --- assets/js/lib/test-utils/factories/index.js | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/assets/js/lib/test-utils/factories/index.js b/assets/js/lib/test-utils/factories/index.js index 390775abd2..1d901f5a35 100644 --- a/assets/js/lib/test-utils/factories/index.js +++ b/assets/js/lib/test-utils/factories/index.js @@ -64,17 +64,21 @@ export const healthSummaryFactory = Factory.define(() => ({ }), })); -export const catalogExpectExpectationFactory = Factory.define(() => ({ - name: faker.animal.cat(), - type: 'expect', - expression: faker.lorem.sentence(), -})); +export const catalogExpectExpectationFactory = Factory.define( + ({ sequence }) => ({ + name: `${faker.lorem.word()}_${sequence}`, + type: 'expect', + expression: faker.lorem.sentence(), + }) +); -export const catalogExpectSameExpectationFactory = Factory.define(() => ({ - name: faker.animal.cat(), - type: 'expect_same', - expression: faker.lorem.sentence(), -})); +export const catalogExpectSameExpectationFactory = Factory.define( + ({ sequence }) => ({ + name: `${faker.lorem.word()}_${sequence}`, + type: 'expect_same', + expression: faker.lorem.sentence(), + }) +); export const catalogCheckFactory = Factory.define(() => ({ id: faker.datatype.uuid(),