',
diff --git a/js/tests/unit/util/scrollbar.spec.js b/js/tests/unit/util/scrollbar.spec.js
index ee17d3c7b4..c42234c4fe 100644
--- a/js/tests/unit/util/scrollbar.spec.js
+++ b/js/tests/unit/util/scrollbar.spec.js
@@ -24,7 +24,9 @@ describe('ScrollBar', () => {
}
}
- const isScrollBarHidden = () => { // IOS devices, Android devices and Browsers on Mac, hide scrollbar by default and appear it, only while scrolling. So the tests for scrollbar would fail
+ // iOS, Android devices and macOS browsers hide scrollbar by default and show it only while scrolling.
+ // So the tests for scrollbar would fail
+ const isScrollBarHidden = () => {
const calc = windowCalculations()
return calc.htmlClient === calc.htmlOffset && calc.htmlClient === calc.window
}
@@ -52,9 +54,7 @@ describe('ScrollBar', () => {
it('should return true if body is overflowing', () => {
document.documentElement.style.overflowY = 'scroll'
document.body.style.overflowY = 'scroll'
- fixtureEl.innerHTML = [
- '
'
- ].join('')
+ fixtureEl.innerHTML = '
'
const result = new ScrollBarHelper().isOverflowing()
if (isScrollBarHidden()) {
@@ -67,9 +67,7 @@ describe('ScrollBar', () => {
it('should return false if body is not overflowing', () => {
doc.style.overflowY = 'hidden'
document.body.style.overflowY = 'hidden'
- fixtureEl.innerHTML = [
- '
'
- ].join('')
+ fixtureEl.innerHTML = '
'
const scrollBar = new ScrollBarHelper()
const result = scrollBar.isOverflowing()
@@ -81,9 +79,7 @@ describe('ScrollBar', () => {
it('should return an integer greater than zero, if body is overflowing', () => {
doc.style.overflowY = 'scroll'
document.body.style.overflowY = 'scroll'
- fixtureEl.innerHTML = [
- '
'
- ].join('')
+ fixtureEl.innerHTML = '
'
const result = new ScrollBarHelper().getWidth()
if (isScrollBarHidden()) {
@@ -96,9 +92,7 @@ describe('ScrollBar', () => {
it('should return 0 if body is not overflowing', () => {
document.documentElement.style.overflowY = 'hidden'
document.body.style.overflowY = 'hidden'
- fixtureEl.innerHTML = [
- '
'
- ].join('')
+ fixtureEl.innerHTML = '
'
const result = new ScrollBarHelper().getWidth()
@@ -109,9 +103,9 @@ describe('ScrollBar', () => {
describe('hide - reset', () => {
it('should adjust the inline padding of fixed elements which are full-width', done => {
fixtureEl.innerHTML = [
- '
' +
- '
',
- '
',
+ '
'
].join('')
doc.style.overflowY = 'scroll'
@@ -145,8 +139,8 @@ describe('ScrollBar', () => {
it('should adjust the inline margin and padding of sticky elements', done => {
fixtureEl.innerHTML = [
- '
' +
- '
',
+ '
'
].join('')
doc.style.overflowY = 'scroll'
@@ -173,9 +167,7 @@ describe('ScrollBar', () => {
})
it('should not adjust the inline margin and padding of sticky and fixed elements when element do not have full width', () => {
- fixtureEl.innerHTML = [
- '
'
- ].join('')
+ fixtureEl.innerHTML = '
'
const stickyTopEl = fixtureEl.querySelector('.sticky-top')
const originalMargin = getMarginX(stickyTopEl)
@@ -195,8 +187,8 @@ describe('ScrollBar', () => {
it('should not put data-attribute if element doesn\'t have the proper style property, should just remove style property if element didn\'t had one', () => {
fixtureEl.innerHTML = [
- '
' +
- '
',
+ '
'
].join('')
@@ -243,7 +235,7 @@ describe('ScrollBar', () => {
fixtureEl.innerHTML = [
''
].join('')
@@ -283,7 +275,7 @@ describe('ScrollBar', () => {
fixtureEl.innerHTML = [
''
].join('')
diff --git a/js/tests/unit/util/swipe.spec.js b/js/tests/unit/util/swipe.spec.js
index 474e34f653..93131b8fdd 100644
--- a/js/tests/unit/util/swipe.spec.js
+++ b/js/tests/unit/util/swipe.spec.js
@@ -39,17 +39,17 @@ describe('Swipe', () => {
fixtureEl = getFixture()
const cssStyle = [
''
].join('')
- fixtureEl.innerHTML = '
' + cssStyle
+ fixtureEl.innerHTML = `
${cssStyle}`
swipeEl = fixtureEl.querySelector('div')
})
@@ -266,7 +266,7 @@ describe('Swipe', () => {
expect(Swipe.isSupported()).toBeTrue()
})
- it('should return "false" if "touchstart" not exists in document element and "navigator.maxTouchPoints" are zero (0)', () => {
+ it('should return "false" if "touchstart" not exists in document element and "navigator.maxTouchPoints" are zero (0)', () => {
Object.defineProperty(window.navigator, 'maxTouchPoints', () => 0)
deleteDocumentElementOntouchstart()
diff --git a/js/tests/unit/util/template-factory.spec.js b/js/tests/unit/util/template-factory.spec.js
index dccf2a5857..0fdf871466 100644
--- a/js/tests/unit/util/template-factory.spec.js
+++ b/js/tests/unit/util/template-factory.spec.js
@@ -113,11 +113,11 @@ describe('TemplateFactory', () => {
describe('Content', () => {
it('add simple text content', () => {
const template = [
- '
' +
- '
' +
- '
' +
+ '
'
- ].join(' ')
+ ].join('')
const factory = new TemplateFactory({
template,
@@ -245,14 +245,15 @@ describe('TemplateFactory', () => {
expect(factory.hasContent()).toBeFalse()
})
})
+
describe('changeContent', () => {
it('should change Content', () => {
const template = [
- '
' +
- '
' +
- '
' +
+ '
'
- ].join(' ')
+ ].join('')
const factory = new TemplateFactory({
template,
@@ -276,11 +277,11 @@ describe('TemplateFactory', () => {
it('should change only the given, content', () => {
const template = [
- '
' +
- '
' +
- '
' +
+ '
'
- ].join(' ')
+ ].join('')
const factory = new TemplateFactory({
template,