Skip to content

Commit ddfe999

Browse files
committed
fix attributes tests
1 parent 2417c15 commit ddfe999

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

packages/qwik/src/core/v2/shared/scheduler.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,8 @@ function choreComparator(a: Chore, b: Chore, shouldThrowOnHostMismatch: boolean)
418418
const aHost = a.$host$;
419419
const bHost = b.$host$;
420420

421-
const aHostIsQrlResolve = a.$type$ === ChoreType.QRL_RESOLVE;
422-
const bHostIsQrlResolve = b.$type$ === ChoreType.QRL_RESOLVE;
423-
424421
// QRL_RESOLVE does not have a host.
425-
if (aHost !== bHost && !aHostIsQrlResolve && !bHostIsQrlResolve) {
422+
if (aHost !== bHost && aHost !== null && bHost !== null) {
426423
if (vnode_isVNode(aHost) && vnode_isVNode(bHost)) {
427424
// we are running on the client.
428425
const hostDiff = vnode_documentPosition(aHost, bHost);
@@ -449,22 +446,20 @@ function choreComparator(a: Chore, b: Chore, shouldThrowOnHostMismatch: boolean)
449446
return microTypeDiff;
450447
}
451448

452-
/**
453-
* QRL_RESOLVE is a special case. It does not have a host nor $idx$. We want to process
454-
* QRL_RESOLVE chores as FIFO, so we need to return 1.
455-
*/
456-
if (
457-
aHostIsQrlResolve &&
458-
bHostIsQrlResolve &&
459-
(a.$target$ as QRLInternal<any>).$symbol$ !== (b.$target$ as QRLInternal<any>).$symbol$
460-
) {
461-
return 1;
462-
}
463-
464449
const idxDiff = toNumber(a.$idx$) - toNumber(b.$idx$);
465450
if (idxDiff !== 0) {
466451
return idxDiff;
467452
}
453+
454+
// If the host is the same, we need to compare the target.
455+
if (
456+
a.$target$ !== b.$target$ &&
457+
((a.$type$ === ChoreType.QRL_RESOLVE && b.$type$ === ChoreType.QRL_RESOLVE) ||
458+
(a.$type$ === ChoreType.NODE_PROP && b.$type$ === ChoreType.NODE_PROP))
459+
) {
460+
// 1 means that we are going to process chores as FIFO
461+
return 1;
462+
}
468463
}
469464

470465
return 0;

packages/qwik/src/core/v2/tests/component.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Error.stackTraceLimit = 100;
2626

2727
describe.each([
2828
{ render: ssrRenderToDom }, //
29-
// { render: domRender }, //
29+
{ render: domRender }, //
3030
])('$render.name: component', ({ render }) => {
3131
it('should render component', async () => {
3232
const MyComp = component$(() => {

starters/e2e/e2e.attributes.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ test.describe("attributes", () => {
135135
test("should update required", async ({ page }) => {
136136
const input = page.locator("#input");
137137
const renders = page.locator("#renders");
138-
const countBtn = page.locator("#required");
139-
await countBtn.click();
138+
const requiredBtn = page.locator("#required");
139+
await requiredBtn.click();
140140

141141
await expect(input).toHaveAttribute("aria-hidden", "true");
142142
await expect(input).toHaveAttribute("aria-label", "even");

0 commit comments

Comments
 (0)