From fc215bd750a5a2d217551d3da82203d287d1968c Mon Sep 17 00:00:00 2001 From: sunil-lakshman <104969541+sunil-lakshman@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:41:12 +0530 Subject: [PATCH] Updated testcases (#198) --- test/unit/index.js | 2 +- test/unit/ungroupedVariants-test.js | 3 +++ test/unit/variantGroup-test.js | 3 +++ test/unit/variantsWithVariantsGroup-test.js | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/unit/index.js b/test/unit/index.js index a7476a69..cde49f51 100644 --- a/test/unit/index.js +++ b/test/unit/index.js @@ -39,7 +39,7 @@ require('./team-test') require('./team-users-test') require('./team-stack-role-mapping-test') require('./managementToken-test') -require('./ungroupedVariants-test') require('./variantGroup-test') +require('./ungroupedVariants-test') require('./variantsWithVariantsGroup-test') require('./variants-entry-test') diff --git a/test/unit/ungroupedVariants-test.js b/test/unit/ungroupedVariants-test.js index e26ade1f..c67e0a55 100644 --- a/test/unit/ungroupedVariants-test.js +++ b/test/unit/ungroupedVariants-test.js @@ -162,6 +162,9 @@ function makeVariants (data = {}) { } function checkVariants (variants) { + if(variants.variants){ + variants = variants.variants + } checkSystemFields(variants) expect(variants.name).to.be.equal('name') } diff --git a/test/unit/variantGroup-test.js b/test/unit/variantGroup-test.js index 8d61c969..ecdb5205 100644 --- a/test/unit/variantGroup-test.js +++ b/test/unit/variantGroup-test.js @@ -159,6 +159,9 @@ function makeVariantGroup (data = {}) { } function checkVariantGroup (variantGroup) { + if(variantGroup.variant_group){ + variantGroup = variantGroup.variant_group + } checkSystemFields(variantGroup) expect(variantGroup.name).to.be.equal('Test') expect(variantGroup.source).to.be.equal('Personalize') diff --git a/test/unit/variantsWithVariantsGroup-test.js b/test/unit/variantsWithVariantsGroup-test.js index dea369d2..f441dedc 100644 --- a/test/unit/variantsWithVariantsGroup-test.js +++ b/test/unit/variantsWithVariantsGroup-test.js @@ -135,6 +135,9 @@ function makeVariants (data = {}) { } function checkVariants (variant) { + if(variant.variants){ + variant = variant.variants + } checkSystemFields(variant) expect(variant.name).to.be.equal('Test') expect(variant.uid).to.be.equal('UID')