Skip to content

Commit

Permalink
Add injectCss test
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Nov 12, 2024
1 parent 4256fdd commit 481e757
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 481e757

Please sign in to comment.