summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2021-01-07 08:33:14 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2021-01-12 23:09:18 +0300
commite88b816d47ce36ebc449b3ad78496916beda8ca4 (patch)
tree700d86cf4c03b8de36a18411fd5365aebcaa1644 /tests
parentff70e9e48682d50e48a5231371e75a782bab1694 (diff)
downloadwebui-vue-e88b816d47ce36ebc449b3ad78496916beda8ca4.tar.xz
Fix broken info-tooltip spec and snapshot
- Two of the test are not needed since they are testing the vue internal functionality of rendering a title attribute value correctly and importing the right carbon icon. For this test the only tests needed is the snapshot. It could be debated that this component does not require a spec at all. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Icca107b185cd579d47877d50ec5763c5ffffc06a
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/Global/InfoTooltip.spec.js8
-rw-r--r--tests/unit/Global/__snapshots__/InfoTooltip.spec.js.snap31
2 files changed, 25 insertions, 14 deletions
diff --git a/tests/unit/Global/InfoTooltip.spec.js b/tests/unit/Global/InfoTooltip.spec.js
index 90cb301e..37290f67 100644
--- a/tests/unit/Global/InfoTooltip.spec.js
+++ b/tests/unit/Global/InfoTooltip.spec.js
@@ -1,7 +1,9 @@
import { mount, createLocalVue } from '@vue/test-utils';
import InfoTooltip from '@/components/Global/InfoTooltip';
+import { BootstrapVue } from 'bootstrap-vue';
const localVue = createLocalVue();
+localVue.use(BootstrapVue);
describe('InfoTooltip.vue', () => {
const wrapper = mount(InfoTooltip, {
@@ -16,12 +18,6 @@ describe('InfoTooltip.vue', () => {
it('should exist', () => {
expect(wrapper.exists()).toBe(true);
});
- it('should render title attribute for button', () => {
- expect(wrapper.attributes('title')).toBe('title');
- });
- it('should render icon-tooltip element', () => {
- expect(wrapper.find('icon-tooltip').exists()).toBe(true);
- });
it('should render correctly', () => {
expect(wrapper.element).toMatchSnapshot();
});
diff --git a/tests/unit/Global/__snapshots__/InfoTooltip.spec.js.snap b/tests/unit/Global/__snapshots__/InfoTooltip.spec.js.snap
index a3fd9be1..9b660389 100644
--- a/tests/unit/Global/__snapshots__/InfoTooltip.spec.js.snap
+++ b/tests/unit/Global/__snapshots__/InfoTooltip.spec.js.snap
@@ -1,13 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`InfoTooltip.vue should render correctly 1`] = `
-<template>
- <b-button
- v-b-tooltip
- variant="link"
- class="btn-tooltip"
+<button
+ aria-label="global.ariaLabel.tooltip"
+ class="btn btn-tooltip btn-icon-only btn-link"
+ title="A tooltip test title"
+ type="button"
+>
+ <svg
+ aria-hidden="true"
+ fill="currentColor"
+ focusable="false"
+ height="16"
+ preserveAspectRatio="xMidYMid meet"
+ viewBox="0 0 16 16"
+ width="16"
+ xmlns="http://www.w3.org/2000/svg"
>
- <icon-tooltip />
- </b-button>
-</template>
+ <path
+ d="M8.5 11L8.5 6.5 6.5 6.5 6.5 7.5 7.5 7.5 7.5 11 6 11 6 12 10 12 10 11zM8 3.5c-.4 0-.8.3-.8.8S7.6 5 8 5c.4 0 .8-.3.8-.8S8.4 3.5 8 3.5z"
+ />
+ <path
+ d="M8,15c-3.9,0-7-3.1-7-7s3.1-7,7-7s7,3.1,7,7S11.9,15,8,15z M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z"
+ />
+ </svg>
+</button>
`;