From 481e75767b9d33f89b6f591eb2fa630465121c04 Mon Sep 17 00:00:00 2001 From: Lauri Rooden Date: Tue, 12 Nov 2024 14:03:39 +0200 Subject: [PATCH] Add injectCss test --- test/ui.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/ui.js b/test/ui.js index 3b60758..d28a1fb 100644 --- a/test/ui.js +++ b/test/ui.js @@ -509,6 +509,26 @@ describe("ui", function() { assert.end() }) + describe("plugins", function() { + function before(newEl, nextSib) { + nextSib.parentNode.insertBefore(newEl, nextSib) + } + + test ("injectCss", function(assert) { + var app = LiteJS({ + root: document.body + }) + + before(El("head"), app.root) + + assert.notOk(document.querySelector("style")) + xhr.ui('%css\n .x{top:1px}') + LiteJS.start() + assert.ok(document.querySelector("style")) + assert.end() + }) + }) + describe("bindings", function() { test ("if", function(assert, mock) { //mock.swap(console, "log", mock.fn())