diff --git a/src/components/SessionInfo.vue b/src/components/SessionInfo.vue index 5e9bc3c..fd7550a 100644 --- a/src/components/SessionInfo.vue +++ b/src/components/SessionInfo.vue @@ -1,29 +1,34 @@ diff --git a/src/components/ui/WTLBanner.vue b/src/components/ui/WTLBanner.vue index f15e353..4329f80 100644 --- a/src/components/ui/WTLBanner.vue +++ b/src/components/ui/WTLBanner.vue @@ -1,83 +1,85 @@ diff --git a/test/unit/specs/components/ui/WTLBanner.spec.js b/test/unit/specs/components/ui/WTLBanner.spec.js new file mode 100644 index 0000000..79a59d8 --- /dev/null +++ b/test/unit/specs/components/ui/WTLBanner.spec.js @@ -0,0 +1,26 @@ +import { mount } from "@vue/test-utils" +import { expect } from "chai" +import WTLBanner from "components/ui/WTLBanner" + +describe("WTLBanner", () => { + let banner = mount(WTLBanner, { + slots: { + default: "Sample text" + } + }) + banner.setProps({ + closable: true, + type: "error" + }) + + it("displays text", () => { + expect(banner.text()).to.equal("Sample text") + }) + + it("closes on button click", () => { + expect(banner.is(".WTLBanner")).to.be.true + let button = banner.find(".WTLBanner__close") + button.trigger("click") + expect(banner.is(".WTLBanner")).to.be.false + }) +})