Skip to content

Commit

Permalink
improve test case stability (#49036)
Browse files Browse the repository at this point in the history
### What?

fix bug and stability of test case

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
sokra and kodiakhq[bot] committed May 2, 2023
1 parent fe38369 commit 9dc0c1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default function A() {

return (
<>
<Link href="/b">B</Link>
<Link className="b" href="/b">
B
</Link>
<button className="a" onClick={() => DYNAMIC_IMPORT1()}>
Load dynamic styles 1
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default function B() {

return (
<>
<Link href="/a">A</Link>
<Link className="a" href="/a">
A
</Link>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function runTests(harness: Harness, iframe: HTMLIFrameElement) {
expect(getComputedStyle(buttonA).color).toEqual('rgb(255, 0, 0)')
const buttonB = await harness.waitForSelector(
iframe.contentWindow!.document,
'button.a'
'button.b'
)
expect(buttonB).not.toBeNull()
expect(getComputedStyle(buttonB).color).toEqual('rgb(255, 0, 0)')
Expand Down Expand Up @@ -94,7 +94,7 @@ function runTests(harness: Harness, iframe: HTMLIFrameElement) {

const link = await harness.waitForSelector(
iframe.contentWindow!.document,
'a'
'a.b'
)
expect(link).toBeInstanceOf(
(iframe.contentWindow as any).HTMLAnchorElement
Expand All @@ -106,7 +106,7 @@ function runTests(harness: Harness, iframe: HTMLIFrameElement) {

const link2 = await harness.waitForSelector(
iframe.contentWindow!.document,
'a'
'a.a'
)
expect(link2).toBeInstanceOf(
(iframe.contentWindow as any).HTMLAnchorElement
Expand All @@ -118,7 +118,7 @@ function runTests(harness: Harness, iframe: HTMLIFrameElement) {

const link3 = await harness.waitForSelector(
iframe.contentWindow!.document,
'a'
'a.b'
)
expect(link3).toBeInstanceOf(
(iframe.contentWindow as any).HTMLAnchorElement
Expand Down

0 comments on commit 9dc0c1e

Please sign in to comment.