summaryrefslogtreecommitdiff
path: root/spec/javascripts/flash_spec.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-10-05 10:27:43 +0100
committerPhil Hughes <me@iamphill.com>2017-10-10 10:14:23 +0100
commitfcd842b55837d2a8eab4ef32b65b5a44dfab6eba (patch)
tree7a6fdd2c94130aab0800d189c881b2bec7ae148a /spec/javascripts/flash_spec.js
parentcbfc97b112849299b0aaf3b5155e278d3db17c91 (diff)
downloadgitlab-ce-fcd842b55837d2a8eab4ef32b65b5a44dfab6eba.tar.gz
fixed notes specs
changed how the container class is added onto the text element more specs
Diffstat (limited to 'spec/javascripts/flash_spec.js')
-rw-r--r--spec/javascripts/flash_spec.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/javascripts/flash_spec.js b/spec/javascripts/flash_spec.js
index 66cc76ee626..060ffaa339b 100644
--- a/spec/javascripts/flash_spec.js
+++ b/spec/javascripts/flash_spec.js
@@ -31,6 +31,17 @@ describe('Flash', () => {
el.querySelector('.flash-text').textContent.trim(),
).toBe('<script>alert("a");</script>');
});
+
+ it('adds container classes when inside content wrapper', () => {
+ el.innerHTML = createFlashEl('testing', 'alert', true);
+
+ expect(
+ el.querySelector('.flash-text').classList.contains('container-fluid'),
+ ).toBeTruthy();
+ expect(
+ el.querySelector('.flash-text').classList.contains('container-limited'),
+ ).toBeTruthy();
+ });
});
describe('hideFlash', () => {
@@ -57,6 +68,17 @@ describe('Flash', () => {
).toBe('0');
});
+ it('does not set styles when fadeTransition is false', () => {
+ hideFlash(el, false);
+
+ expect(
+ el.style.opacity,
+ ).toBe('');
+ expect(
+ el.style.transition,
+ ).toBe('');
+ });
+
it('removes element after transitionend', () => {
document.body.appendChild(el);
@@ -192,7 +214,7 @@ describe('Flash', () => {
flash('test');
expect(
- document.querySelector('.flash-text').className,
+ document.querySelector('.flash-text').className.trim(),
).toBe('flash-text');
});