diff --git a/src/qComponents/QPopover/QPopover.test.js b/src/qComponents/QPopover/QPopover.test.js
new file mode 100644
index 00000000..8dfeb4e7
--- /dev/null
+++ b/src/qComponents/QPopover/QPopover.test.js
@@ -0,0 +1,100 @@
+import Component from './index';
+
+describe('QPopover', () => {
+ const options = {
+ slots: {
+ reference: ''
+ }
+ };
+
+ it('should match snapshot', () => {
+ const { element } = shallowMount(Component, options);
+ expect(element).toMatchSnapshot();
+ });
+
+ it('data should match snapshot', () => {
+ expect(Component.data()).toMatchSnapshot();
+ });
+
+ describe('computed', () => {
+ describe('popoverClasses', () => {
+ it('should return expected value if icon does not exist', () => {
+ const instance = shallowMount(Component, options);
+ instance.setProps({
+ icon: ''
+ });
+ const expected = {
+ 'q-popover_without-icon': true
+ };
+ expect(instance.vm.popoverClasses).toEqual(expected);
+ });
+
+ it('should return expected value if icon exists', () => {
+ const instance = shallowMount(Component, options);
+ instance.setProps({
+ icon: 'icon-name'
+ });
+ const expected = {
+ 'q-popover_without-icon': false
+ };
+ expect(instance.vm.popoverClasses).toEqual(expected);
+ });
+ });
+ });
+
+ describe('methods', () => {
+ describe('togglePopover', () => {
+ it('should set isPopoverShown to false', () => {
+ const instance = shallowMount(Component, options);
+ instance.setData({
+ isPopoverShown: true
+ });
+ instance.vm.togglePopover();
+ expect(instance.vm.isPopoverShown).toBeFalsy();
+ });
+
+ it('should set isPopoverShown to true', () => {
+ const instance = shallowMount(Component, options);
+ instance.setData({
+ isPopoverShown: false
+ });
+ instance.vm.togglePopover();
+ expect(instance.vm.isPopoverShown).toBeTruthy();
+ });
+ });
+
+ describe('destroy', () => {
+ it('should set isPopoverShown to false', () => {
+ const instance = shallowMount(Component, options);
+ instance.setData({
+ isPopoverShown: true
+ });
+ instance.vm.destroy();
+ expect(instance.vm.isPopoverShown).toBeFalsy();
+ });
+
+ it('should call destroy', () => {
+ const instance = shallowMount(Component, options);
+ const spy = jest.fn(() => {});
+ instance.setData({
+ popperJS: {
+ destroy: spy
+ }
+ });
+ instance.vm.destroy();
+ expect(spy).toBeCalled();
+ });
+
+ it('should set popperJS to null', () => {
+ const instance = shallowMount(Component, options);
+ instance.setData({
+ popperJS: {
+ destroy: () => {}
+ }
+ });
+ instance.vm.destroy();
+ expect(instance.vm.popperJS).toBeNull();
+ });
+ });
+ });
+});
diff --git a/src/qComponents/QPopover/__snapshots__/QPopover.test.js.snap b/src/qComponents/QPopover/__snapshots__/QPopover.test.js.snap
new file mode 100644
index 00000000..9c1becdb
--- /dev/null
+++ b/src/qComponents/QPopover/__snapshots__/QPopover.test.js.snap
@@ -0,0 +1,40 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`QPopover data should match snapshot 1`] = `
+Object {
+ "isPopoverShown": false,
+ "popperJS": null,
+ "referenceElement": null,
+ "zIndex": null,
+}
+`;
+
+exports[`QPopover should match snapshot 1`] = `
+
+
-
-
-
-
- Column 1
-
+
+ Column 1
+
+
+
|
---|