Skip to content

Commit 550da05

Browse files
fix: test typos
1 parent 8be0a75 commit 550da05

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

packages/@lwc/engine-core/src/framework/__tests__/context.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const setFeatureFlag = (name: string, value: boolean) => {
4848
* functions regardless of whether trusted context has been defined or not.
4949
* Integration tests have been used for extensive coverage of the LWC context feature, but this particular
5050
* scenario is best isolated and unit tested as it involves manipulation of the trusted context API.
51+
* See bug fix: #5492
5152
*/
5253
describe('context functions', () => {
5354
beforeAll(() => {

packages/@lwc/engine-core/src/framework/__tests__/mutation-tracker.spec.ts

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,38 @@ const setFeatureFlag = (name: string, value: boolean) => {
3232
* regardless of whether trusted context has been defined by a state manager or not.
3333
* Integration tests have been used for extensive coverage of the LWC signals feature, but this particular
3434
* scenario is best isolated and unit tested as it involves manipulation of the trusted context API.
35+
* See bug fix: #5492
3536
*/
3637
describe('mutation-tracker', () => {
37-
it('should not throw when componentValueObserved is called using the new signals validation and no signal set is defined', () => {
38-
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', false);
39-
expect(() => {
40-
componentValueObserved(mockVM, 'testKey', {});
41-
}).not.toThrow();
42-
});
38+
describe('trustedSignal set not defined', () => {
39+
it('should not throw when componentValueObserved is called using the new signals validation', () => {
40+
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', false);
41+
expect(() => {
42+
componentValueObserved(mockVM, 'testKey', {});
43+
}).not.toThrow();
44+
});
4345

44-
it('should throw when componentValueObserved is called using legacy signals validation and no signal set has been defined', () => {
45-
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', true);
46-
expect(() => {
47-
componentValueObserved(mockVM, 'testKey', {});
48-
}).toThrow();
46+
it('should throw when componentValueObserved is called using legacy signals validation', () => {
47+
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', true);
48+
expect(() => {
49+
componentValueObserved(mockVM, 'testKey', {});
50+
}).toThrow();
51+
});
4952
});
5053

51-
it('should not throw when a trusted signal set is defined abd componentValueObserved is called', () => {
52-
setTrustedSignalSet(new WeakSet());
53-
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', false);
54-
expect(() => {
55-
componentValueObserved(mockVM, 'testKey', {});
56-
}).not.toThrow();
54+
describe('trustedSignal set defined', () => {
55+
it('should not throw when componentValueObserved is called, regardless of validation type', () => {
56+
setTrustedSignalSet(new WeakSet());
57+
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', false);
58+
expect(() => {
59+
componentValueObserved(mockVM, 'testKey', {});
60+
}).not.toThrow();
5761

58-
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', true);
59-
expect(() => {
60-
componentValueObserved(mockVM, 'testKey', {});
61-
}).not.toThrow();
62+
setFeatureFlag('ENABLE_LEGACY_SIGNAL_CONTEXT_VALIDATION', true);
63+
expect(() => {
64+
componentValueObserved(mockVM, 'testKey', {});
65+
}).not.toThrow();
66+
});
6267
});
6368

6469
beforeAll(() => {

0 commit comments

Comments
 (0)