diff options
Diffstat (limited to 'js/tests/unit/alert.spec.js')
-rw-r--r-- | js/tests/unit/alert.spec.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/js/tests/unit/alert.spec.js b/js/tests/unit/alert.spec.js index eb3d3e5fa3..210ae9a25e 100644 --- a/js/tests/unit/alert.spec.js +++ b/js/tests/unit/alert.spec.js @@ -25,7 +25,7 @@ describe('Alert', () => { }) it('should return version', () => { - expect(typeof Alert.VERSION).toEqual('string') + expect(Alert.VERSION).toEqual(jasmine.any(String)) }) describe('DATA_KEY', () => { @@ -45,7 +45,7 @@ describe('Alert', () => { const button = document.querySelector('button') button.click() - expect(document.querySelectorAll('.alert').length).toEqual(0) + expect(document.querySelectorAll('.alert')).toHaveSize(0) }) it('should close an alert without instantiating it manually with the parent selector', () => { @@ -58,7 +58,7 @@ describe('Alert', () => { const button = document.querySelector('button') button.click() - expect(document.querySelectorAll('.alert').length).toEqual(0) + expect(document.querySelectorAll('.alert')).toHaveSize(0) }) }) @@ -71,7 +71,7 @@ describe('Alert', () => { const alert = new Alert(alertEl) alertEl.addEventListener('closed.bs.alert', () => { - expect(document.querySelectorAll('.alert').length).toEqual(0) + expect(document.querySelectorAll('.alert')).toHaveSize(0) expect(spy).not.toHaveBeenCalled() done() }) @@ -90,7 +90,7 @@ describe('Alert', () => { }) alertEl.addEventListener('closed.bs.alert', () => { - expect(document.querySelectorAll('.alert').length).toEqual(0) + expect(document.querySelectorAll('.alert')).toHaveSize(0) done() }) @@ -225,7 +225,7 @@ describe('Alert', () => { const div = fixtureEl.querySelector('div') - expect(Alert.getInstance(div)).toEqual(null) + expect(Alert.getInstance(div)).toBeNull() }) }) @@ -246,7 +246,7 @@ describe('Alert', () => { const div = fixtureEl.querySelector('div') - expect(Alert.getInstance(div)).toEqual(null) + expect(Alert.getInstance(div)).toBeNull() expect(Alert.getOrCreateInstance(div)).toBeInstanceOf(Alert) }) }) |