diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-16 21:35:58 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-17 23:06:27 +0900 |
commit | fb8b4d28ce47171a83a7bf5148293fd2318cc02f (patch) | |
tree | 02e23efe01d38adeb6dafb6794bc1d3e4866a055 /test/content/components | |
parent | 8cef5981b808bc1713170627c88dc26ca81063c1 (diff) |
Hints as a classes
Diffstat (limited to 'test/content/components')
-rw-r--r-- | test/content/components/common/hint.html | 1 | ||||
-rw-r--r-- | test/content/components/common/hint.test.ts | 57 |
2 files changed, 0 insertions, 58 deletions
diff --git a/test/content/components/common/hint.html b/test/content/components/common/hint.html deleted file mode 100644 index b50c5fe..0000000 --- a/test/content/components/common/hint.html +++ /dev/null @@ -1 +0,0 @@ -<a id='test-link' href='javascript:window.vimvixenTest="hello"' >link</a> diff --git a/test/content/components/common/hint.test.ts b/test/content/components/common/hint.test.ts deleted file mode 100644 index 42d571f..0000000 --- a/test/content/components/common/hint.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import Hint from 'content/components/common/hint'; - -describe('Hint class', () => { - beforeEach(() => { - document.body.innerHTML = __html__['test/content/components/common/hint.html']; - }); - - describe('#constructor', () => { - it('creates a hint element with tag name', () => { - let link = document.getElementById('test-link'); - let hint = new Hint(link, 'abc'); - expect(hint.element.textContent.trim()).to.be.equal('abc'); - }); - - it('throws an exception when non-element given', () => { - expect(() => new Hint(window, 'abc')).to.throw(TypeError); - }); - }); - - describe('#show', () => { - it('shows an element', () => { - let link = document.getElementById('test-link'); - let hint = new Hint(link, 'abc'); - hint.hide(); - hint.show(); - - expect(hint.element.style.display).to.not.equal('none'); - }); - }); - - describe('#hide', () => { - it('hides an element', () => { - let link = document.getElementById('test-link'); - let hint = new Hint(link, 'abc'); - hint.hide(); - - expect(hint.element.style.display).to.equal('none'); - }); - }); - - describe('#remove', () => { - it('removes an element', () => { - let link = document.getElementById('test-link'); - let hint = new Hint(link, 'abc'); - - expect(hint.element.parentElement).to.not.be.null; - hint.remove(); - expect(hint.element.parentElement).to.be.null; - }); - }); - - describe('#activate', () => { - // TODO test activations - }); -}); - - |