27 lines
No EOL
866 B
JavaScript
27 lines
No EOL
866 B
JavaScript
import baseMixin from "@/mixins/base-mixin"
|
|
import { shallowMount, mount } from "@vue/test-utils";
|
|
|
|
|
|
describe("base-mixin", () => {
|
|
|
|
it("should set and get cms content", () => {
|
|
const expected = "test";
|
|
const wrapper = shallowMount(baseMixin, {
|
|
propsData: {
|
|
cmsContentByWidget: {}
|
|
}
|
|
})
|
|
const cmsContent = { testWidget: { fieldName: expected }};
|
|
|
|
wrapper.componentVM.setCmsContent(cmsContent);
|
|
const actual = wrapper.componentVM.getCmsContent("testWidget", "fieldName");
|
|
expect(actual).toEqual(expected);
|
|
});
|
|
|
|
it("should return formatted class name for cmswidget", () => {
|
|
|
|
const localThis = { cmsWidgetName: "testWidget" }
|
|
expect(baseMixin.computed.cssClassNameForCmsWidget.call(localThis)).toBe("widget-name-testWidget")
|
|
|
|
});
|
|
}); |