Skip to content

Commit b702267

Browse files
authored
new tests (#175)
1 parent 2fdd3f3 commit b702267

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

test/lib/rules/no-restricted-browser-globals-during-ssr.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,17 @@ testRule('no-restricted-browser-globals-during-ssr', {
319319
}
320320
`,
321321
},
322+
{
323+
code: `
324+
import { LightningElement } from 'lwc';
325+
326+
export default class Foo extends LightningElement {
327+
handleFocus() {
328+
console.log(window.location.href);
329+
}
330+
}
331+
`,
332+
},
322333
],
323334
invalid: [
324335
{

test/lib/rules/no-unsupported-ssr-properties.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,17 @@ testRule('no-unsupported-ssr-properties', {
196196
}
197197
`,
198198
},
199+
{
200+
code: `
201+
import { LightningElement } from 'lwc';
202+
203+
export default class Foo extends LightningElement {
204+
handleFocus() {
205+
this.dispatchEvent(new CustomEvent('focus'));
206+
}
207+
}
208+
`,
209+
},
199210
],
200211
invalid: [
201212
{

0 commit comments

Comments
 (0)