From 624a94bc7c59a3b6a8475fc87c63b5fef3fc1f7b Mon Sep 17 00:00:00 2001 From: yandeu <20306025+yandeu@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:56:49 +0200 Subject: [PATCH] dev --- test/browser/link.test.html | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/browser/link.test.html b/test/browser/link.test.html index d9dd850..46fb0c6 100644 --- a/test/browser/link.test.html +++ b/test/browser/link.test.html @@ -86,10 +86,22 @@ expect(window.__gotohref__).toBe('https://nanojsx.github.io/') }) - describe('Back (TODO)', async () => { - const back = (Link, { back: true, href: 'https://nanojsx.github.io/' }, 'nanojsx.github.io') + describe('Back (target.href)', async () => { + const App = () => h(Link, { back: true, href: 'https://nanojsx.github.io/' }, 'nanojsx.github.io') - expect('skip', null).toBe(null, 'Should test "back"') + render(App, root()) + + await Test.wait() + + /** @type {HTMLLinkElement} */ + const link = root()?.firstChild + link.click() + + expect(window.__gotohref__).toBe('https://nanojsx.github.io/') + }) + + describe('Back (window.history.back)', async () => { + expect('skip', null).toBe(null, 'Should test "window.history.back()"') }) Test.start()