summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-02-17 13:36:21 +0000
committerMichael Williamson <mike@zwobble.org>2024-02-17 13:36:21 +0000
commit2ab691683d81b1481f68d19295f6ba86f02fdd3a (patch)
treed903cda7ea366883a727eb521eecb02a9587a873 /test
parent318145ae7e4cdc02e418f25032159fa40cd47a19 (diff)
Support attributes in HTML paths in style mappings
Diffstat (limited to 'test')
-rw-r--r--test/style-reader.tests.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/style-reader.tests.js b/test/style-reader.tests.js
index b77ce7e..93ddc79 100644
--- a/test/style-reader.tests.js
+++ b/test/style-reader.tests.js
@@ -54,6 +54,20 @@ test('styleReader.readHtmlPath', {
assertHtmlPath("p.tip.help", expected);
},
+ 'reads attribute on element': function() {
+ var expected = htmlPaths.elements([
+ htmlPaths.element("p", {"lang": "fr"})
+ ]);
+ assertHtmlPath("p[lang='fr']", expected);
+ },
+
+ 'reads multiple attributes on element': function() {
+ var expected = htmlPaths.elements([
+ htmlPaths.element("p", {"lang": "fr", "data-x": "y"})
+ ]);
+ assertHtmlPath("p[lang='fr'][data-x='y']", expected);
+ },
+
'reads when element must be fresh': function() {
var expected = htmlPaths.elements([
htmlPaths.element("p", {}, {"fresh": true})