aboutsummaryrefslogtreecommitdiff
path: root/js/tests/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/README.md')
-rw-r--r--js/tests/README.md30
1 files changed, 16 insertions, 14 deletions
diff --git a/js/tests/README.md b/js/tests/README.md
index 1e96a6b5d..79d05d444 100644
--- a/js/tests/README.md
+++ b/js/tests/README.md
@@ -35,7 +35,7 @@ Currently we're aiming for at least 90% test coverage for our code. To ensure yo
describe('getInstance', () => {
it('should return null if there is no instance', () => {
// Make assertion
- expect(Tab.getInstance(fixtureEl)).toEqual(null)
+ expect(Tab.getInstance(fixtureEl)).toBeNull()
})
it('should return this instance', () => {
@@ -50,22 +50,24 @@ describe('getInstance', () => {
})
// Asynchronous test
-it('should show a tooltip without the animation', done => {
- fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
+it('should show a tooltip without the animation', () => {
+ return new Promise(resolve => {
+ fixtureEl.innerHTML = '<a href="#" rel="tooltip" title="Another tooltip"></a>'
- const tooltipEl = fixtureEl.querySelector('a')
- const tooltip = new Tooltip(tooltipEl, {
- animation: false
- })
+ const tooltipEl = fixtureEl.querySelector('a')
+ const tooltip = new Tooltip(tooltipEl, {
+ animation: false
+ })
- tooltipEl.addEventListener('shown.bs.tooltip', () => {
- const tip = document.querySelector('.tooltip')
+ tooltipEl.addEventListener('shown.bs.tooltip', () => {
+ const tip = document.querySelector('.tooltip')
- expect(tip).not.toBeNull()
- expect(tip.classList.contains('fade')).toEqual(false)
- done()
- })
+ expect(tip).not.toBeNull()
+ expect(tip.classList.contains('fade')).toEqual(false)
+ resolve()
+ })
- tooltip.show()
+ tooltip.show()
+ })
})
```