From e68ea17e396b7379ef5b3c50cdc0b1fd0d656253 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Mon, 11 Dec 2023 13:33:35 -0500 Subject: [PATCH 1/2] test(client-assets): update test for relative app bundle location --- src/test/java/itest/ClientAssetsIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/itest/ClientAssetsIT.java b/src/test/java/itest/ClientAssetsIT.java index 73da9bec55..1b66271926 100644 --- a/src/test/java/itest/ClientAssetsIT.java +++ b/src/test/java/itest/ClientAssetsIT.java @@ -72,7 +72,7 @@ public void indexHtmlShouldHaveScriptTag() { boolean foundAppBundle = false; for (Element el : scripts) { - foundAppBundle |= el.attr("src").matches("^/app(?:.\\w*)?\\.bundle\\.js$"); + foundAppBundle |= el.attr("src").matches("^app(?:.\\w*)?\\.bundle\\.js$"); } Assertions.assertTrue(foundAppBundle, "No app.bundle.js script tag found"); } From d5879ee85fed7ab3a939cc40ec22446d5f913607 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Mon, 11 Dec 2023 13:33:46 -0500 Subject: [PATCH 2/2] add test for relative base href --- src/test/java/itest/ClientAssetsIT.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/itest/ClientAssetsIT.java b/src/test/java/itest/ClientAssetsIT.java index 1b66271926..99f51bc395 100644 --- a/src/test/java/itest/ClientAssetsIT.java +++ b/src/test/java/itest/ClientAssetsIT.java @@ -59,6 +59,18 @@ public void indexHtmlShouldHaveTitle() { MatcherAssert.assertThat(titles.first().text(), Matchers.equalTo("Cryostat")); } + @Test + public void indexHtmlShouldHaveRelativeBaseHref() { + Elements head = doc.getElementsByTag("head"); + MatcherAssert.assertThat("Expected one ", head.size(), Matchers.equalTo(1)); + + Elements bases = head.first().getElementsByTag("base"); + MatcherAssert.assertThat("Expected one ", bases.size(), Matchers.equalTo(1)); + + Element base = bases.get(0); + MatcherAssert.assertThat(base.attr("href"), Matchers.equalTo("./")); + } + @Test public void indexHtmlShouldHaveScriptTag() { Elements head = doc.getElementsByTag("head");