-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b91b947
commit 39e124e
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import assert from "assert"; | ||
import {default as rtl} from "../src/rtl.js"; | ||
import it from "./jsdom.js"; | ||
|
||
it("rtl", () => { | ||
assert.strictEqual(false, rtl(), "default ltr"); | ||
}); | ||
|
||
it("rtl - html", "<!doctype html><html dir='rtl'><head><meta charset='utf-8'></head><body></body></html>", () => { | ||
assert.strictEqual(true, rtl(), "detect HTML attribute"); | ||
}); | ||
|
||
it("rtl - body", "<!doctype html><html><head><meta charset='utf-8'></head><body dir='rtl'></body></html>", () => { | ||
assert.strictEqual(true, rtl(), "detect BODY attribute"); | ||
}); | ||
|
||
it("rtl - nested", "<!doctype html><html><head><meta charset='utf-8'></head><body><main dir='rtl'><svg id='test'></svg></main></body></html>", () => { | ||
assert.strictEqual(true, rtl(document.querySelector("#test")), "detect nested inheritance"); | ||
}); |