aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/collapse.spec.js8
-rw-r--r--js/tests/unit/scrollspy.spec.js2
-rw-r--r--js/tests/unit/util/index.spec.js4
-rw-r--r--js/tests/unit/util/sanitizer.spec.js1
4 files changed, 8 insertions, 7 deletions
diff --git a/js/tests/unit/collapse.spec.js b/js/tests/unit/collapse.spec.js
index da709bb85..082e6505f 100644
--- a/js/tests/unit/collapse.spec.js
+++ b/js/tests/unit/collapse.spec.js
@@ -734,7 +734,7 @@ describe('Collapse', () => {
two: false
}
- function firstTest() {
+ const firstTest = () => {
expect(collapseOneOne.classList.contains('show')).toEqual(true)
expect(collapseOneTwo.classList.contains('show')).toEqual(true)
@@ -744,7 +744,7 @@ describe('Collapse', () => {
triggerTwo.click()
}
- function secondTest() {
+ const secondTest = () => {
expect(collapseOneOne.classList.contains('show')).toEqual(false)
expect(collapseOneTwo.classList.contains('show')).toEqual(false)
@@ -816,7 +816,7 @@ describe('Collapse', () => {
const collapseTwo = fixtureEl.querySelector('#collapseTwo')
const nestedCollapseOne = fixtureEl.querySelector('#nestedCollapseOne')
- function handlerCollapseOne() {
+ const handlerCollapseOne = () => {
expect(collapseOne.classList.contains('show')).toEqual(true)
expect(collapseTwo.classList.contains('show')).toEqual(false)
expect(nestedCollapseOne.classList.contains('show')).toEqual(false)
@@ -826,7 +826,7 @@ describe('Collapse', () => {
collapseOne.removeEventListener('shown.bs.collapse', handlerCollapseOne)
}
- function handlerNestedCollapseOne() {
+ const handlerNestedCollapseOne = () => {
expect(collapseOne.classList.contains('show')).toEqual(true)
expect(collapseTwo.classList.contains('show')).toEqual(false)
expect(nestedCollapseOne.classList.contains('show')).toEqual(true)
diff --git a/js/tests/unit/scrollspy.spec.js b/js/tests/unit/scrollspy.spec.js
index ad44d5b3c..66e4cd7bf 100644
--- a/js/tests/unit/scrollspy.spec.js
+++ b/js/tests/unit/scrollspy.spec.js
@@ -15,7 +15,7 @@ describe('ScrollSpy', () => {
const paddingTop = 5
const scrollHeight = Math.ceil(contentEl.scrollTop + Manipulator.position(target).top) + paddingTop
- function listener() {
+ const listener = () => {
expect(element.classList.contains('active')).toEqual(true)
contentEl.removeEventListener('scroll', listener)
expect(scrollSpy._process).toHaveBeenCalled()
diff --git a/js/tests/unit/util/index.spec.js b/js/tests/unit/util/index.spec.js
index 38e94dc6b..2563aad8f 100644
--- a/js/tests/unit/util/index.spec.js
+++ b/js/tests/unit/util/index.spec.js
@@ -625,9 +625,9 @@ describe('Util', () => {
})
it('should define a plugin on the jQuery instance', () => {
- const pluginMock = function () {}
+ const pluginMock = () => {}
pluginMock.NAME = 'test'
- pluginMock.jQueryInterface = function () {}
+ pluginMock.jQueryInterface = () => {}
Util.defineJQueryPlugin(pluginMock)
expect(fakejQuery.fn.test).toBe(pluginMock.jQueryInterface)
diff --git a/js/tests/unit/util/sanitizer.spec.js b/js/tests/unit/util/sanitizer.spec.js
index 7379d221f..6aa307f72 100644
--- a/js/tests/unit/util/sanitizer.spec.js
+++ b/js/tests/unit/util/sanitizer.spec.js
@@ -55,6 +55,7 @@ describe('Sanitizer', () => {
'</div>'
].join('')
+ // eslint-disable-next-line func-style
function mySanitize(htmlUnsafe) {
return htmlUnsafe
}