diff --git a/src/action-bar-icon/test/__snapshots__/index.spec.js.snap b/src/action-bar-icon/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..f81cb1b2a --- /dev/null +++ b/src/action-bar-icon/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render default slot and match snapshot 1`] = ` +
+
+ + + +
Content +
+`; + +exports[`should render icon slot and match snapshot 1`] = ` +
+
Custom Icon + +
Content +
+`; + +exports[`should render icon slot with badge and match snapshot 1`] = ` +
+
Custom Icon
1
+
Content +
+`; + +exports[`should render icon slot with dot and match snapshot 1`] = ` +
+
Custom Icon
+ +
+
Content +
+`; diff --git a/src/action-bar-icon/test/index.spec.js b/src/action-bar-icon/test/index.spec.js new file mode 100644 index 000000000..42360fa36 --- /dev/null +++ b/src/action-bar-icon/test/index.spec.js @@ -0,0 +1,50 @@ +import { mount } from '@vue/test-utils'; +import ActionBarIcon from '..'; + +test('should render default slot and match snapshot', () => { + const wrapper = mount(ActionBarIcon, { + slots: { + default: 'Content', + }, + }); + expect(wrapper.html()).toMatchSnapshot(); +}); + +test('should render icon slot and match snapshot', () => { + const wrapper = mount(ActionBarIcon, { + slots: { + default: 'Content', + icon: 'Custom Icon', + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); +}); + +test('should render icon slot with badge and match snapshot', () => { + const wrapper = mount(ActionBarIcon, { + props: { + badge: '1', + }, + slots: { + default: 'Content', + icon: 'Custom Icon', + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); +}); + +test('should render icon slot with dot and match snapshot', () => { + const wrapper = mount(ActionBarIcon, { + props: { + dot: true, + }, + slots: { + default: 'Content', + icon: 'Custom Icon', + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); +}); diff --git a/src/action-bar/test/__snapshots__/index.legacy.js.snap b/src/action-bar/test/__snapshots__/index.legacy.js.snap deleted file mode 100644 index d83e14ad9..000000000 --- a/src/action-bar/test/__snapshots__/index.legacy.js.snap +++ /dev/null @@ -1,39 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Button render default slot 1`] = ` - -`; - -exports[`Icon render default slot 1`] = ` -
-
- -
Default Content -
-`; - -exports[`Icon render icon slot 1`] = ` -
-
Custom Icon - -
Text -
-`; - -exports[`Icon render icon slot with dot 1`] = ` -
-
Custom Icon
-
Text -
-`; - -exports[`Icon render icon slot with badge 1`] = ` -
-
Custom Icon
1
-
Text -
-`; - -exports[`disable safe-area-inset-bottom prop 1`] = `
`; diff --git a/src/action-bar/test/__snapshots__/index.spec.js.snap b/src/action-bar/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..8db696ffd --- /dev/null +++ b/src/action-bar/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should allow to disable safe-area-inset-bottom prop 1`] = ` +
+ +
+`; diff --git a/src/action-bar/test/index.legacy.js b/src/action-bar/test/index.legacy.js deleted file mode 100644 index b484f1b44..000000000 --- a/src/action-bar/test/index.legacy.js +++ /dev/null @@ -1,80 +0,0 @@ -import ActionBar from '..'; -import Icon from '../../action-bar-icon'; -import { mount } from '../../../test'; - -test('Icon click event', () => { - const wrapper = mount(Icon); - wrapper.trigger('click'); - expect(wrapper.emitted('click').length).toEqual(1); -}); - -test('Icon render default slot', () => { - const wrapper = mount({ - render(h) { - return h(Icon, null, ['Default Content']); - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); - -test('Icon render icon slot', () => { - const wrapper = mount({ - render(h) { - return h(Icon, { - scopedSlots: { - default: () => 'Text', - icon: () => 'Custom Icon', - }, - }); - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); - -test('Icon render icon slot with badge', () => { - const wrapper = mount({ - render(h) { - return h(Icon, { - props: { - badge: '1', - }, - scopedSlots: { - default: () => 'Text', - icon: () => 'Custom Icon', - }, - }); - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); - -test('Icon render icon slot with dot', () => { - const wrapper = mount({ - render(h) { - return h(Icon, { - props: { - dot: true, - }, - scopedSlots: { - default: () => 'Text', - icon: () => 'Custom Icon', - }, - }); - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); - -test('disable safe-area-inset-bottom prop', () => { - const wrapper = mount(ActionBar, { - propsData: { - safeAreaInsetBottom: false, - }, - }); - - expect(wrapper.html()).toMatchSnapshot(); -}); diff --git a/src/action-bar/test/index.spec.js b/src/action-bar/test/index.spec.js new file mode 100644 index 000000000..f955f4c66 --- /dev/null +++ b/src/action-bar/test/index.spec.js @@ -0,0 +1,12 @@ +import ActionBar from '..'; +import { mount } from '../../../test'; + +test('should allow to disable safe-area-inset-bottom prop', () => { + const wrapper = mount(ActionBar, { + propsData: { + safeAreaInsetBottom: false, + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); +});