summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_shared
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 12:08:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 12:08:40 +0000
commitbe3e24ea3c9f497efde85900df298ce9bc42fce8 (patch)
treefd0de9443253a1b21ca9a2741dc34ba3aef795be /spec/frontend/vue_shared
parent001243986195143c395a9811d8254bbf1b9ebfa1 (diff)
downloadgitlab-ce-be3e24ea3c9f497efde85900df298ce9bc42fce8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r--spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap88
-rw-r--r--spec/frontend/vue_shared/components/expand_button_spec.js4
2 files changed, 83 insertions, 9 deletions
diff --git a/spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap b/spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap
index 3a518029702..2abcc53bf14 100644
--- a/spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap
+++ b/spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap
@@ -1,14 +1,88 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Expand button on click when short text is provided renders button after text 1`] = `
-"<span><button aria-label=\\"Click to expand text\\" type=\\"button\\" class=\\"btn js-text-expander-prepend text-expander btn-blank btn-secondary\\" style=\\"display: none;\\"><svg aria-hidden=\\"true\\" class=\\"s12 ic-ellipsis_h\\"><use xlink:href=\\"#ellipsis_h\\"></use></svg></button> <!----> <span><p>Expanded!</p></span> <button aria-label=\\"Click to expand text\\" type=\\"button\\" class=\\"btn js-text-expander-append text-expander btn-blank btn-secondary\\" style=\\"\\"><svg aria-hidden=\\"true\\" class=\\"s12 ic-ellipsis_h\\">
- <use xlink:href=\\"#ellipsis_h\\"></use>
- </svg></button></span>"
+<span>
+ <button
+ aria-label="Click to expand text"
+ class="btn js-text-expander-prepend text-expander btn-blank btn-secondary btn-md"
+ style="display: none;"
+ type="button"
+ >
+ <svg
+ aria-hidden="true"
+ class="s12 ic-ellipsis_h"
+ >
+ <use
+ xlink:href="#ellipsis_h"
+ />
+ </svg>
+ </button>
+
+ <!---->
+
+ <span>
+ <p>
+ Expanded!
+ </p>
+ </span>
+
+ <button
+ aria-label="Click to expand text"
+ class="btn js-text-expander-append text-expander btn-blank btn-secondary btn-md"
+ style=""
+ type="button"
+ >
+ <svg
+ aria-hidden="true"
+ class="s12 ic-ellipsis_h"
+ >
+ <use
+ xlink:href="#ellipsis_h"
+ />
+ </svg>
+ </button>
+</span>
`;
exports[`Expand button when short text is provided renders button before text 1`] = `
-"<span><button aria-label=\\"Click to expand text\\" type=\\"button\\" class=\\"btn js-text-expander-prepend text-expander btn-blank btn-secondary\\"><svg aria-hidden=\\"true\\" class=\\"s12 ic-ellipsis_h\\"><use xlink:href=\\"#ellipsis_h\\"></use></svg></button> <span><p>Short</p></span>
-<!----> <button aria-label=\\"Click to expand text\\" type=\\"button\\" class=\\"btn js-text-expander-append text-expander btn-blank btn-secondary\\" style=\\"display: none;\\"><svg aria-hidden=\\"true\\" class=\\"s12 ic-ellipsis_h\\">
- <use xlink:href=\\"#ellipsis_h\\"></use>
- </svg></button></span>"
+<span>
+ <button
+ aria-label="Click to expand text"
+ class="btn js-text-expander-prepend text-expander btn-blank btn-secondary btn-md"
+ type="button"
+ >
+ <svg
+ aria-hidden="true"
+ class="s12 ic-ellipsis_h"
+ >
+ <use
+ xlink:href="#ellipsis_h"
+ />
+ </svg>
+ </button>
+
+ <span>
+ <p>
+ Short
+ </p>
+ </span>
+
+ <!---->
+
+ <button
+ aria-label="Click to expand text"
+ class="btn js-text-expander-append text-expander btn-blank btn-secondary btn-md"
+ style="display: none;"
+ type="button"
+ >
+ <svg
+ aria-hidden="true"
+ class="s12 ic-ellipsis_h"
+ >
+ <use
+ xlink:href="#ellipsis_h"
+ />
+ </svg>
+ </button>
+</span>
`;
diff --git a/spec/frontend/vue_shared/components/expand_button_spec.js b/spec/frontend/vue_shared/components/expand_button_spec.js
index 3b1c8f6219c..aea90e5b31f 100644
--- a/spec/frontend/vue_shared/components/expand_button_spec.js
+++ b/spec/frontend/vue_shared/components/expand_button_spec.js
@@ -71,7 +71,7 @@ describe('Expand button', () => {
it('renders button before text', () => {
expect(expanderPrependEl().isVisible()).toBe(true);
expect(expanderAppendEl().isVisible()).toBe(false);
- expect(wrapper.find(ExpandButton).html()).toMatchSnapshot();
+ expect(wrapper.find(ExpandButton).element).toMatchSnapshot();
});
});
@@ -119,7 +119,7 @@ describe('Expand button', () => {
it('renders button after text', () => {
expect(expanderPrependEl().isVisible()).toBe(false);
expect(expanderAppendEl().isVisible()).toBe(true);
- expect(wrapper.find(ExpandButton).html()).toMatchSnapshot();
+ expect(wrapper.find(ExpandButton).element).toMatchSnapshot();
});
});
});