diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /remote/test/puppeteer/test-d/NodeFor.test-d.ts | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'remote/test/puppeteer/test-d/NodeFor.test-d.ts')
-rw-r--r-- | remote/test/puppeteer/test-d/NodeFor.test-d.ts | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/remote/test/puppeteer/test-d/NodeFor.test-d.ts b/remote/test/puppeteer/test-d/NodeFor.test-d.ts new file mode 100644 index 0000000000..a478b5952c --- /dev/null +++ b/remote/test/puppeteer/test-d/NodeFor.test-d.ts @@ -0,0 +1,156 @@ +import type {NodeFor} from 'puppeteer'; +import {expectType, expectNotType} from 'tsd'; + +declare const nodeFor: <Selector extends string>( + selector: Selector +) => NodeFor<Selector>; + +{ + { + expectType<HTMLTableRowElement>( + nodeFor( + '[data-testid="my-component"] div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div tbody tr' + ) + ); + expectNotType<Element>( + nodeFor( + '[data-testid="my-component"] div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div div tbody tr' + ) + ); + } + { + expectType<HTMLAnchorElement>(nodeFor('a')); + expectNotType<Element>(nodeFor('a')); + } + { + expectType<HTMLAnchorElement>(nodeFor('a#ignored')); + expectNotType<Element>(nodeFor('a#ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('a.ignored')); + expectNotType<Element>(nodeFor('a.ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('a[ignored')); + expectNotType<Element>(nodeFor('a[ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('a:ignored')); + expectNotType<Element>(nodeFor('a:ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored a')); + expectNotType<Element>(nodeFor('ignored a')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored a#ignored')); + expectNotType<Element>(nodeFor('ignored a#ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored a.ignored')); + expectNotType<Element>(nodeFor('ignored a.ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored a[ignored')); + expectNotType<Element>(nodeFor('ignored a[ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored a:ignored')); + expectNotType<Element>(nodeFor('ignored a:ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored > a')); + expectNotType<Element>(nodeFor('ignored > a')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored > a#ignored')); + expectNotType<Element>(nodeFor('ignored > a#ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored > a.ignored')); + expectNotType<Element>(nodeFor('ignored > a.ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored > a[ignored')); + expectNotType<Element>(nodeFor('ignored > a[ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored > a:ignored')); + expectNotType<Element>(nodeFor('ignored > a:ignored')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored + a')); + expectNotType<Element>(nodeFor('ignored + a')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored ~ a')); + expectNotType<Element>(nodeFor('ignored ~ a')); + } + { + expectType<HTMLAnchorElement>(nodeFor('ignored | a')); + expectNotType<Element>(nodeFor('ignored | a')); + } + { + expectType<HTMLAnchorElement>( + nodeFor('ignored ignored > ignored + ignored | a#ignore') + ); + expectNotType<Element>( + nodeFor('ignored ignored > ignored + ignored | a#ignore') + ); + } +} +{ + { + expectType<Element>(nodeFor('')); + } + { + expectType<Element>(nodeFor('#ignored')); + } + { + expectType<Element>(nodeFor('.ignored')); + } + { + expectType<Element>(nodeFor('[ignored')); + } + { + expectType<Element>(nodeFor(':ignored')); + } + { + expectType<Element>(nodeFor('ignored #ignored')); + } + { + expectType<Element>(nodeFor('ignored .ignored')); + } + { + expectType<Element>(nodeFor('ignored [ignored')); + } + { + expectType<Element>(nodeFor('ignored :ignored')); + } + { + expectType<Element>(nodeFor('ignored > #ignored')); + } + { + expectType<Element>(nodeFor('ignored > .ignored')); + } + { + expectType<Element>(nodeFor('ignored > [ignored')); + } + { + expectType<Element>(nodeFor('ignored > :ignored')); + } + { + expectType<Element>(nodeFor('ignored + #ignored')); + } + { + expectType<Element>(nodeFor('ignored ~ #ignored')); + } + { + expectType<Element>(nodeFor('ignored | #ignored')); + } + { + expectType<Element>( + nodeFor('ignored ignored > ignored ~ ignored + ignored | #ignored') + ); + } +} |