Merge branch 'develop' into feature/CSR-762
This commit is contained in:
commit
14da65ad25
2 changed files with 61 additions and 2 deletions
|
|
@ -9,7 +9,7 @@
|
||||||
<p class="fw-bold mb-2 subheader-text" v-html="this.ModalSubheadertext"></p>
|
<p class="fw-bold mb-2 subheader-text" v-html="this.ModalSubheadertext"></p>
|
||||||
<p class="mb-0" v-html="this.ModalBodyText"></p>
|
<p class="mb-0" v-html="this.ModalBodyText"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer pt-4 pb-5">
|
<div class="modal-footer px-4 pt-4 pb-5">
|
||||||
<button class="btn btn-secondary w-100" data-bs-dismiss="modal" v-html="this.ModalCloseButtonText"></button>
|
<button class="btn btn-secondary w-100" data-bs-dismiss="modal" v-html="this.ModalCloseButtonText"></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1 +1,60 @@
|
||||||
test.todo("some test to be written in the future");
|
import { shallowMount } from "@vue/test-utils";
|
||||||
|
import TextBlock from "./text-block";
|
||||||
|
|
||||||
|
|
||||||
|
describe("modal.vue", () => {
|
||||||
|
it("Should display 'Text' when 'Text' is defined in the CMS", async () => {
|
||||||
|
// Act
|
||||||
|
const wrapper = shallowMount(TextBlock, {
|
||||||
|
mixins: [mockMixin]
|
||||||
|
});
|
||||||
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent['Text']));
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Should contain the typeStyle class as defined by the prop", async () => {
|
||||||
|
// Act
|
||||||
|
const wrapper = shallowMount(TextBlock, {
|
||||||
|
mixins: [mockMixin],
|
||||||
|
propsData: mockProps,
|
||||||
|
});
|
||||||
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockProps['typeStyle']));
|
||||||
|
});
|
||||||
|
it("Should contain the justifyText class as defined by the prop", async () => {
|
||||||
|
// Act
|
||||||
|
const wrapper = shallowMount(TextBlock, {
|
||||||
|
mixins: [mockMixin],
|
||||||
|
propsData: mockProps,
|
||||||
|
});
|
||||||
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockProps['justifyText']));
|
||||||
|
});
|
||||||
|
it("Should contain the fontWeight class as defined by the prop", async () => {
|
||||||
|
// Act
|
||||||
|
const wrapper = shallowMount(TextBlock, {
|
||||||
|
mixins: [mockMixin],
|
||||||
|
propsData: mockProps,
|
||||||
|
});
|
||||||
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockProps['fontWeight']));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
///////////////
|
||||||
|
// Constants //
|
||||||
|
///////////////
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, cmsFieldName) => {
|
||||||
|
return mockCmsContent[cmsFieldName];
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mockProps = {
|
||||||
|
fontWeight: 'mockFontWeight',
|
||||||
|
typeStyle: 'mockTypeStyle',
|
||||||
|
justifyText: 'mockJustifyText'
|
||||||
|
}
|
||||||
|
|
||||||
|
const mockCmsContent = {
|
||||||
|
'Text': "Sample text here.",
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue