Skip to content

Commit 1e0810c

Browse files
authored
fix(dialtone-vue): DP-203134 hide empty message paragraph in DtNoticeContent (#1390)
1 parent f871496 commit 1e0810c

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

packages/dialtone-vue/components/Notice/NoticeContent.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,21 @@ describe('DtNoticeContent tests', () => {
6464
expect(header.text()).toBe(slotsData.header);
6565
});
6666
});
67+
68+
describe('When no message content is provided', () => {
69+
beforeEach(() => {
70+
props = baseProps;
71+
slotsData = {};
72+
wrapper = mount(DtNoticeContent, {
73+
props,
74+
slots: slotsData,
75+
});
76+
_setChildWrappers();
77+
});
78+
79+
it('does not render the message element', () => {
80+
expect(content.exists()).toBe(false);
81+
});
82+
});
6783
});
6884
});

packages/dialtone-vue/components/Notice/NoticeContent.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
</slot>
2020
</dt-text>
2121
<dt-text
22+
v-if="hasSlotContent($slots.default)"
2223
:id="contentId"
2324
kind="body"
2425
:size="200"

0 commit comments

Comments
 (0)