mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 09:47:56 +08:00
This also adds CC-BY-4.0 to the list of accepted licenses. DISABLE_THIRD_PARTY_CHECK=update dependencies Bug: chromium:1083142 Change-Id: I8612de2fba52dae32eeb71af79d5aacfde52142b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2220097 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org>
66 lines
3.1 KiB
JavaScript
66 lines
3.1 KiB
JavaScript
"use strict";
|
|
|
|
var _helpers = require("./util/helpers");
|
|
|
|
(0, _helpers.test)('match tags in the postcss namespace', 'postcss|button', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'postcss');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, 'button');
|
|
});
|
|
(0, _helpers.test)('match everything in the postcss namespace', 'postcss|*', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'postcss');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, '*');
|
|
});
|
|
(0, _helpers.test)('match any namespace', '*|button', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, '*');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, 'button');
|
|
});
|
|
(0, _helpers.test)('match all elements within the postcss namespace', 'postcss|*', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'postcss');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, '*');
|
|
});
|
|
(0, _helpers.test)('match all elements in all namespaces', '*|*', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, '*');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, '*');
|
|
});
|
|
(0, _helpers.test)('match all elements without a namespace', '|*', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, true);
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, '*');
|
|
});
|
|
(0, _helpers.test)('match tags with no namespace', '|button', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, true);
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, 'button');
|
|
});
|
|
(0, _helpers.test)('match namespace inside attribute selector', '[postcss|href=test]', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'postcss');
|
|
t.deepEqual(tree.nodes[0].nodes[0].value, 'test');
|
|
});
|
|
(0, _helpers.test)('match namespace inside attribute selector (2)', '[postcss|href]', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'postcss');
|
|
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'href');
|
|
});
|
|
(0, _helpers.test)('match namespace inside attribute selector (3)', '[*|href]', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, '*');
|
|
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'href');
|
|
});
|
|
(0, _helpers.test)('match default namespace inside attribute selector', '[|href]', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, true);
|
|
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'href');
|
|
});
|
|
(0, _helpers.test)('match default namespace inside attribute selector with spaces', '[ |href ]', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, true);
|
|
t.deepEqual(tree.nodes[0].nodes[0].attribute, 'href');
|
|
});
|
|
(0, _helpers.test)('namespace with qualified id selector', 'ns|h1#foo', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'ns');
|
|
});
|
|
(0, _helpers.test)('namespace with qualified class selector', 'ns|h1.foo', function (t, tree) {
|
|
t.deepEqual(tree.nodes[0].nodes[0].namespace, 'ns');
|
|
});
|
|
(0, _helpers.test)('ns alias for namespace', 'f\\oo|h1.foo', function (t, tree) {
|
|
var tag = tree.nodes[0].nodes[0];
|
|
t.deepEqual(tag.namespace, 'foo');
|
|
t.deepEqual(tag.ns, 'foo');
|
|
tag.ns = "bar";
|
|
t.deepEqual(tag.namespace, 'bar');
|
|
t.deepEqual(tag.ns, 'bar');
|
|
}); |