diff --git a/packages/distribution/addon/components/cd-inquiry-new-form/group-type.hbs b/packages/distribution/addon/components/cd-inquiry-new-form/group-type.hbs index 12cb2df72..aa7473f80 100644 --- a/packages/distribution/addon/components/cd-inquiry-new-form/group-type.hbs +++ b/packages/distribution/addon/components/cd-inquiry-new-form/group-type.hbs @@ -1,23 +1,25 @@ {{! template-lint-disable require-presentational-children }} - - -
- {{t @type.name}} - -
- - -{{#if this.isExpanded}} - {{#each @type.groups as |group|}} - - {{/each}} +{{#if @type.groups.length}} + + +
+ {{t @type.name}} + +
+ + + {{#if this.isExpanded}} + {{#each @type.groups as |group|}} + + {{/each}} + {{/if}} {{/if}} \ No newline at end of file diff --git a/packages/distribution/tests/integration/components/cd-inquiry-new-form-test.js b/packages/distribution/tests/integration/components/cd-inquiry-new-form-test.js index 8dc5e316b..d90b81950 100644 --- a/packages/distribution/tests/integration/components/cd-inquiry-new-form-test.js +++ b/packages/distribution/tests/integration/components/cd-inquiry-new-form-test.js @@ -33,6 +33,7 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) { }, a: { label: "label-a" }, b: { label: "label-b" }, + c: { label: "label-c" }, }, }, }; @@ -51,6 +52,7 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) { { id: 4, name: "4" }, { id: 5, name: "5" }, ], + c: [], }; return Object.entries(records).reduce((retval, [type, recs]) => { @@ -79,7 +81,7 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) { { owner: this.engine }, ); - assert.dom("button[data-test-type]").exists({ count: 2 }); + assert.dom("button[data-test-type]").exists({ count: 3 }); assert.dom("tr[data-test-group]").exists({ count: 2 }); await click("button[data-test-type=b]"); @@ -232,10 +234,11 @@ module("Integration | Component | cd-inquiry-new-form", function (hooks) { assert.dom("[data-test-group-toggle-bar]").isNotVisible(); }); - test("it shows all the enabled groups", async function (assert) { + test("it shows all the enabled groups with content", async function (assert) { assert.dom('[data-test-group-type="suggestions"]').isNotVisible(); assert.dom('[data-test-group-type="label-a"]').isVisible(); assert.dom('[data-test-group-type="label-b"]').isVisible(); + assert.dom('[data-test-group-type="label-c"]').doesNotExist(); }); test("it allows the toggling of a group", async function (assert) {