@blockquote/create-wc 2.2.12 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
]
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
72
|
-
"@html-eslint/parser": "^0.
|
|
71
|
+
"@html-eslint/eslint-plugin": "^0.39.0",
|
|
72
|
+
"@html-eslint/parser": "^0.39.0",
|
|
73
73
|
"eslint": "^9.24.0",
|
|
74
74
|
"eslint-config-prettier": "^10.1.2",
|
|
75
75
|
"eslint-plugin-html": "^8.1.2",
|
|
76
76
|
"eslint-plugin-import": "^2.31.0",
|
|
77
|
-
"eslint-plugin-lit": "^2.
|
|
77
|
+
"eslint-plugin-lit": "^2.1.1",
|
|
78
78
|
"eslint-plugin-lit-a11y": "^4.1.4",
|
|
79
79
|
"eslint-plugin-wc": "^3.0.0",
|
|
80
|
-
"@typescript-eslint/parser": "^8.
|
|
81
|
-
"typescript-eslint": "^8.
|
|
80
|
+
"@typescript-eslint/parser": "^8.30.1",
|
|
81
|
+
"typescript-eslint": "^8.30.1",
|
|
82
82
|
"globals": "^16.0.0",
|
|
83
83
|
"husky": "^9.1.7",
|
|
84
84
|
"lint-staged": "^15.5.1",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
35
35
|
"@open-wc/semantic-dom-diff": "^0.20.1",
|
|
36
36
|
"@open-wc/testing": "^4.0.0",
|
|
37
|
-
"playwright": "^1.
|
|
37
|
+
"playwright": "^1.52.0",
|
|
38
38
|
"postcss-html": "1.8.0",
|
|
39
39
|
"postcss-lit": "^1.2.0",
|
|
40
40
|
"@types/mocha": "^10.0.10",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@vitest/coverage-v8": "^3.1.1",
|
|
49
49
|
"@vitest/ui": "^3.1.1",
|
|
50
50
|
"vitest": "^3.1.1",
|
|
51
|
-
"vite": "^6.
|
|
51
|
+
"vite": "^6.3.1"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {beforeAll, afterAll, beforeEach, afterEach, suite, assert, expect, vi, test} from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {getElementLocatorSelectors} from '@vitest/browser/utils';
|
|
3
3
|
import {html} from 'lit';
|
|
4
4
|
import {getDiffableHTML} from '@open-wc/semantic-dom-diff';
|
|
5
5
|
import {assert as a11y, fixture, fixtureCleanup} from '@open-wc/testing';
|
|
@@ -17,16 +17,16 @@ suite('<%= className %>', () => {
|
|
|
17
17
|
beforeAll(async () => {
|
|
18
18
|
el = await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`);
|
|
19
19
|
elShadowRoot = el?.shadowRoot?.innerHTML;
|
|
20
|
-
elLocator =
|
|
20
|
+
elLocator = getElementLocatorSelectors(el);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
afterAll(() => {
|
|
24
24
|
fixtureCleanup();
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
test('has a default heading "Hey there" and counter 5',
|
|
28
|
-
const button =
|
|
29
|
-
const heading =
|
|
27
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
28
|
+
const button = elLocator.getByText('Counter: 5').query();
|
|
29
|
+
const heading = elLocator.getByText('Hey there').query();
|
|
30
30
|
assert.isOk(button);
|
|
31
31
|
assert.isOk(heading);
|
|
32
32
|
});
|
|
@@ -47,7 +47,7 @@ suite('<%= className %>', () => {
|
|
|
47
47
|
suite('Events ', () => {
|
|
48
48
|
beforeEach(async () => {
|
|
49
49
|
el = await fixture(html`<<%= tagName %>></<%= tagName %>>`);
|
|
50
|
-
elLocator =
|
|
50
|
+
elLocator = getElementLocatorSelectors(el);
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
afterEach(() => {
|
|
@@ -65,8 +65,7 @@ suite('<%= className %>', () => {
|
|
|
65
65
|
test('counterchange event is dispatched', async () => {
|
|
66
66
|
const spyEvent = vi.spyOn(el, 'dispatchEvent');
|
|
67
67
|
const button = elLocator.getByText('Counter: 5');
|
|
68
|
-
|
|
69
|
-
await userEvent.click(elButton);
|
|
68
|
+
await button.click();
|
|
70
69
|
await el.updateComplete;
|
|
71
70
|
const calledWithCounterChange = spyEvent.mock.lastCall?.[0].type === 'counterchange';
|
|
72
71
|
assert.isTrue(calledWithCounterChange);
|
|
@@ -76,7 +75,7 @@ suite('<%= className %>', () => {
|
|
|
76
75
|
suite('Override ', () => {
|
|
77
76
|
beforeAll(async () => {
|
|
78
77
|
el = await fixture(html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`);
|
|
79
|
-
elLocator =
|
|
78
|
+
elLocator = getElementLocatorSelectors(el);
|
|
80
79
|
|
|
81
80
|
return () => {
|
|
82
81
|
fixtureCleanup();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {beforeAll, afterAll, beforeEach, afterEach, suite, assert, expect, vi, test} from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {type LocatorSelectors} from '@vitest/browser/context';
|
|
3
|
+
import {getElementLocatorSelectors} from '@vitest/browser/utils';
|
|
3
4
|
import {html} from 'lit';
|
|
4
5
|
import {getDiffableHTML} from '@open-wc/semantic-dom-diff';
|
|
5
6
|
import {assert as a11y, fixture, fixtureCleanup} from '@open-wc/testing';
|
|
@@ -9,22 +10,22 @@ import '../src/define/<%= tagName %>.js';
|
|
|
9
10
|
suite('<%= className %>', () => {
|
|
10
11
|
let el: <%= className %>;
|
|
11
12
|
let elShadowRoot: string;
|
|
12
|
-
let elLocator:
|
|
13
|
+
let elLocator: LocatorSelectors;
|
|
13
14
|
|
|
14
15
|
suite('Semantic Dom and a11y', () => {
|
|
15
16
|
beforeAll(async () => {
|
|
16
17
|
el = await fixture(html`<<%= tagName %>>light-dom</<%= tagName %>>`);
|
|
17
18
|
elShadowRoot = el?.shadowRoot!.innerHTML;
|
|
18
|
-
elLocator =
|
|
19
|
+
elLocator = getElementLocatorSelectors(el);
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
afterAll(() => {
|
|
22
23
|
fixtureCleanup();
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
test('has a default heading "Hey there" and counter 5',
|
|
26
|
-
const button =
|
|
27
|
-
const heading =
|
|
26
|
+
test('has a default heading "Hey there" and counter 5', () => {
|
|
27
|
+
const button = elLocator.getByText('Counter: 5').query();
|
|
28
|
+
const heading = elLocator.getByText('Hey there').query();
|
|
28
29
|
assert.isOk(button);
|
|
29
30
|
assert.isOk(heading);
|
|
30
31
|
});
|
|
@@ -45,7 +46,7 @@ suite('<%= className %>', () => {
|
|
|
45
46
|
suite('Events ', () => {
|
|
46
47
|
beforeEach(async () => {
|
|
47
48
|
el = await fixture(html`<<%= tagName %>></<%= tagName %>>`);
|
|
48
|
-
elLocator =
|
|
49
|
+
elLocator = getElementLocatorSelectors(el);
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
afterEach(() => {
|
|
@@ -63,8 +64,7 @@ suite('<%= className %>', () => {
|
|
|
63
64
|
test('counterchange event is dispatched', async () => {
|
|
64
65
|
const spyEvent = vi.spyOn(el, 'dispatchEvent');
|
|
65
66
|
const button = elLocator.getByText('Counter: 5');
|
|
66
|
-
|
|
67
|
-
await userEvent.click(elButton);
|
|
67
|
+
await button.click();
|
|
68
68
|
await el.updateComplete;
|
|
69
69
|
const calledWithCounterChange = spyEvent.mock.lastCall?.[0].type === 'counterchange';
|
|
70
70
|
assert.isTrue(calledWithCounterChange);
|
|
@@ -74,7 +74,7 @@ suite('<%= className %>', () => {
|
|
|
74
74
|
suite('Override ', () => {
|
|
75
75
|
beforeAll(async () => {
|
|
76
76
|
el = await fixture(html`<<%= tagName %> heading="attribute heading"></<%= tagName %>>`);
|
|
77
|
-
elLocator =
|
|
77
|
+
elLocator = getElementLocatorSelectors(el);
|
|
78
78
|
|
|
79
79
|
return () => {
|
|
80
80
|
fixtureCleanup();
|