implement go-parent command

This commit is contained in:
Shin'ya Ueoka 2017-09-17 12:52:24 +09:00
parent 0be9776cb3
commit e9863299ab
6 changed files with 34 additions and 5 deletions

View file

@ -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;
});
});
});