|
|
@ -2,9 +2,6 @@ import { expect } from "chai"; |
|
|
|
import * as navigates from '../../src/content/navigates'; |
|
|
|
import * as navigates from '../../src/content/navigates'; |
|
|
|
|
|
|
|
|
|
|
|
describe('navigates module', () => { |
|
|
|
describe('navigates module', () => { |
|
|
|
beforeEach(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('#linkPrev', () => { |
|
|
|
describe('#linkPrev', () => { |
|
|
|
it('clicks prev link by text content', (done) => { |
|
|
|
it('clicks prev link by text content', (done) => { |
|
|
|
document.body.innerHTML = '<a href="#dummy">xprevx</a> <a href="#prev">go to prev</a>'; |
|
|
|
document.body.innerHTML = '<a href="#dummy">xprevx</a> <a href="#prev">go to prev</a>'; |
|
|
@ -45,6 +42,15 @@ describe('navigates module', () => { |
|
|
|
}, 0); |
|
|
|
}, 0); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('#parent', () => { |
|
|
|
|
|
|
|
// NOTE: not able to test location
|
|
|
|
|
|
|
|
it('removes hash', () => { |
|
|
|
|
|
|
|
window.location.hash = "#section-1"; |
|
|
|
|
|
|
|
navigates.parent(window); |
|
|
|
|
|
|
|
expect(document.location.hash).to.be.empty; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|