Skip to content

Commit 9d45c70

Browse files
committed
test(wtr): revert removing TestUtils
1 parent 4fef7a9 commit 9d45c70

File tree

56 files changed

+58
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+58
-114
lines changed

packages/@lwc/integration-not-karma/test-hydration/attributes/falsy-mismatch/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../helpers/utils.js';
21
export default {
32
props: {
43
isFalse: false,
@@ -29,7 +28,7 @@ export default {
2928
expect(divs[i].getAttribute('data-foo')).toEqual(expectedAttrValues[i]);
3029
}
3130

32-
expectConsoleCallsDev(consoleCalls, {
31+
TestUtils.expectConsoleCallsDev(consoleCalls, {
3332
error: [],
3433
warn: [
3534
'Hydration attribute mismatch on: <div> - rendered on server: data-foo=null - expected on client: data-foo="undefined"',

packages/@lwc/integration-not-karma/test-hydration/context/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCalls } from '../../helpers/utils.js';
21
export default {
32
// server is expected to generate the same console error as the client
43
expectedSSRConsoleCalls: {
@@ -41,7 +40,7 @@ export default {
4140
// Expect an error as one context was generated twice.
4241
// Expect an error as one context was malformed (did not define connectContext or disconnectContext methods).
4342
// Expect server/client context output parity (no hydration warnings)
44-
expectConsoleCalls(consoleCalls, {
43+
TestUtils.expectConsoleCalls(consoleCalls, {
4544
error: [],
4645
warn: [
4746
'Attempted to connect to trusted context but received the following error',

packages/@lwc/integration-not-karma/test-hydration/errors/already-hydrated/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCalls } from '../../../helpers/utils.js';
21
export default {
32
advancedTest(target, { Component, hydrateComponent, consoleSpy }) {
43
hydrateComponent(target, Component, {});
@@ -7,7 +6,7 @@ export default {
76

87
const consoleCalls = consoleSpy.calls;
98

10-
expectConsoleCalls(consoleCalls, {
9+
TestUtils.expectConsoleCalls(consoleCalls, {
1110
warn: ['"hydrateComponent" expects an element that is not hydrated.'],
1211
});
1312
},

packages/@lwc/integration-not-karma/test-hydration/inner-outer-html/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { extractDataIds } from '../../helpers/utils.js';
21
export default {
32
props: {},
43
advancedTest(target, { consoleSpy }) {
5-
const ids = Object.entries(extractDataIds(target)).filter(
4+
const ids = Object.entries(TestUtils.extractDataIds(target)).filter(
65
([id]) => !id.endsWith('.shadowRoot')
76
);
87
for (const [id, node] of ids) {

packages/@lwc/integration-not-karma/test-hydration/light-dom/scoped-styles/deduped-scoped-styles/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { expectConsoleCalls } from '../../../../helpers/utils.js';
21
export default {
32
test(target, snapshot, consoleCalls) {
43
// W-19087941: Expect no errors or warnings, hydration or otherwise
5-
expectConsoleCalls(consoleCalls, {
4+
TestUtils.expectConsoleCalls(consoleCalls, {
65
error: [],
76
warn: [],
87
});

packages/@lwc/integration-not-karma/test-hydration/mismatches/attrs-compatibility/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../helpers/utils.js';
21
export default {
32
props: {
43
ssr: true,
@@ -19,7 +18,7 @@ export default {
1918
expect(p.getAttribute('data-same')).toBe('same-value');
2019
expect(p.getAttribute('data-another-diff')).toBe('client-val');
2120

22-
expectConsoleCallsDev(consoleCalls, {
21+
TestUtils.expectConsoleCallsDev(consoleCalls, {
2322
error: [],
2423
warn: [
2524
'Hydration attribute mismatch on: <p> - rendered on server: title="ssr-title" - expected on client: title="client-title"',

packages/@lwc/integration-not-karma/test-hydration/mismatches/attrs-expression/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../helpers/utils.js';
21
export default {
32
props: {
43
foo: 'server',
@@ -18,7 +17,7 @@ export default {
1817
expect(div.getAttribute('data-foo')).toBe('client');
1918
expect(div.getAttribute('data-static')).toBe('same-value');
2019

21-
expectConsoleCallsDev(consoleCalls, {
20+
TestUtils.expectConsoleCallsDev(consoleCalls, {
2221
error: [],
2322
warn: [
2423
'Hydration attribute mismatch on: <div> - rendered on server: data-foo="server" - expected on client: data-foo="client"',

packages/@lwc/integration-not-karma/test-hydration/mismatches/class-attr/dynamic-different/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../../helpers/utils.js';
21
export default {
32
props: {
43
classes: 'c1 c2 c3',
@@ -19,7 +18,7 @@ export default {
1918
expect(p).not.toBe(snapshots.p);
2019
expect(p.className).not.toBe(snapshots.classes);
2120

22-
expectConsoleCallsDev(consoleCalls, {
21+
TestUtils.expectConsoleCallsDev(consoleCalls, {
2322
error: [],
2423
warn: [
2524
'Hydration attribute mismatch on: <p> - rendered on server: class="c1 c2 c3" - expected on client: class="c2 c3 c4"',

packages/@lwc/integration-not-karma/test-hydration/mismatches/class-attr/dynamic-empty-in-ssr-null-string-in-client/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../../helpers/utils.js';
21
// SSR has no class at all, whereas the client has `class="null"`.
32
// This is to test if hydration is smart enough to recognize the difference between a null
43
// attribute and the literal string "null".
@@ -22,7 +21,7 @@ export default {
2221
expect(p).not.toBe(snapshots.p);
2322
expect(p.className).not.toBe(snapshots.className);
2423

25-
expectConsoleCallsDev(consoleCalls, {
24+
TestUtils.expectConsoleCallsDev(consoleCalls, {
2625
error: [],
2726
warn: [
2827
'Hydration attribute mismatch on: <p> - rendered on server: class="" - expected on client: class="null"',

packages/@lwc/integration-not-karma/test-hydration/mismatches/class-attr/dynamic-null-string-in-ssr-empty-in-client/index.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { expectConsoleCallsDev } from '../../../../helpers/utils.js';
21
// SSR has `class="null"`, whereas the client has no class at all.
32
// This is to test if hydration is smart enough to recognize the difference between a null
43
// attribute and the literal string "null".
@@ -22,7 +21,7 @@ export default {
2221
expect(p).not.toBe(snapshots.p);
2322
expect(p.className).not.toBe(snapshots.className);
2423

25-
expectConsoleCallsDev(consoleCalls, {
24+
TestUtils.expectConsoleCallsDev(consoleCalls, {
2625
error: [],
2726
warn: [
2827
'Hydration attribute mismatch on: <p> - rendered on server: class="null" - expected on client: class=""',

0 commit comments

Comments
 (0)