implement go-parent command
This commit is contained in:
parent
0be9776cb3
commit
e9863299ab
6 changed files with 34 additions and 5 deletions
|
@ -2,9 +2,6 @@ import { expect } from "chai";
|
|||
import * as navigates from '../../src/content/navigates';
|
||||
|
||||
describe('navigates module', () => {
|
||||
beforeEach(() => {
|
||||
});
|
||||
|
||||
describe('#linkPrev', () => {
|
||||
it('clicks prev link by text content', (done) => {
|
||||
document.body.innerHTML = '<a href="#dummy">xprevx</a> <a href="#prev">go to prev</a>';
|
||||
|
@ -45,6 +42,15 @@ describe('navigates module', () => {
|
|||
}, 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;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
Reference in a new issue