@politiet/sheriff-web-components 2.7.1 → 2.7.2

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.
Files changed (46) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/mixins/sds-popover-target-mixin.d.ts +1 -1
  3. package/dist/mixins/sds-popover-target-mixin.d.ts.map +1 -1
  4. package/dist/mixins/sds-popover-target-mixin.js.map +1 -1
  5. package/dist/sds-button/sds-button.component.d.ts +1 -1
  6. package/dist/sds-button/sds-button.component.d.ts.map +1 -1
  7. package/dist/sds-button/sds-button.component.js.map +1 -1
  8. package/dist/sds-popover/assets/popover-styles.d.ts.map +1 -1
  9. package/dist/sds-popover/assets/popover-styles.js +1 -1
  10. package/dist/sds-popover/assets/popover-styles.js.map +1 -1
  11. package/dist/shared/assets/positioning.js +1 -1
  12. package/dist/sheriff-web-components.js +22 -22
  13. package/package.json +1 -1
  14. package/web-types.json +5 -9
  15. package/dist/playwright-util/custom-matchers.d.ts +0 -7
  16. package/dist/playwright-util/custom-matchers.d.ts.map +0 -1
  17. package/dist/playwright-util/custom-matchers.js +0 -21
  18. package/dist/playwright-util/custom-matchers.js.map +0 -1
  19. package/dist/playwright-util/form.d.ts +0 -3
  20. package/dist/playwright-util/form.d.ts.map +0 -1
  21. package/dist/playwright-util/form.js +0 -44
  22. package/dist/playwright-util/form.js.map +0 -1
  23. package/dist/sds-button/sds-button.spec.d.ts +0 -2
  24. package/dist/sds-button/sds-button.spec.d.ts.map +0 -1
  25. package/dist/sds-button/sds-button.spec.js +0 -182
  26. package/dist/sds-button/sds-button.spec.js.map +0 -1
  27. package/dist/sds-checkbox/sds-checkbox.spec.d.ts +0 -2
  28. package/dist/sds-checkbox/sds-checkbox.spec.d.ts.map +0 -1
  29. package/dist/sds-checkbox/sds-checkbox.spec.js +0 -74
  30. package/dist/sds-checkbox/sds-checkbox.spec.js.map +0 -1
  31. package/dist/sds-dialog/sds-dialog.spec.d.ts +0 -2
  32. package/dist/sds-dialog/sds-dialog.spec.d.ts.map +0 -1
  33. package/dist/sds-dialog/sds-dialog.spec.js +0 -64
  34. package/dist/sds-dialog/sds-dialog.spec.js.map +0 -1
  35. package/dist/sds-radio/sds-radio.spec.d.ts +0 -2
  36. package/dist/sds-radio/sds-radio.spec.d.ts.map +0 -1
  37. package/dist/sds-radio/sds-radio.spec.js +0 -71
  38. package/dist/sds-radio/sds-radio.spec.js.map +0 -1
  39. package/dist/sds-textfield/sds-textfield.spec.d.ts +0 -2
  40. package/dist/sds-textfield/sds-textfield.spec.d.ts.map +0 -1
  41. package/dist/sds-textfield/sds-textfield.spec.js +0 -137
  42. package/dist/sds-textfield/sds-textfield.spec.js.map +0 -1
  43. package/dist/sds-tooltip/sds-tooltip.spec.d.ts +0 -2
  44. package/dist/sds-tooltip/sds-tooltip.spec.d.ts.map +0 -1
  45. package/dist/sds-tooltip/sds-tooltip.spec.js +0 -35
  46. package/dist/sds-tooltip/sds-tooltip.spec.js.map +0 -1
@@ -1,7 +0,0 @@
1
- import { ExpectMatcherState, Locator, MatcherReturnType } from '@playwright/test';
2
- export declare const expect: import("@playwright/test").Expect<{
3
- isChecked(this: ExpectMatcherState, receiver: Locator): Promise<MatcherReturnType>;
4
- isNotChecked(this: ExpectMatcherState, receiver: Locator): Promise<MatcherReturnType>;
5
- toHaveValue(this: ExpectMatcherState, receiver: Locator, expected: string): Promise<MatcherReturnType>;
6
- }>;
7
- //# sourceMappingURL=custom-matchers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-matchers.d.ts","sourceRoot":"","sources":["../../src/playwright-util/custom-matchers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEtG,eAAO,MAAM,MAAM;oBACI,kBAAkB,YAAY,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;uBAK/D,kBAAkB,YAAY,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;sBAInE,kBAAkB,YAAY,OAAO,YAAY,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;EAQ3G,CAAC"}
@@ -1,21 +0,0 @@
1
- import { expect as pwExpect } from '@playwright/test';
2
- export const expect = pwExpect.extend({
3
- async isChecked(receiver) {
4
- console.log(await receiver.getAttribute('checked'));
5
- expect(await receiver.getAttribute('checked')).toBe('');
6
- return { message: () => 'Pass', pass: true };
7
- },
8
- async isNotChecked(receiver) {
9
- expect(await receiver.getAttribute('checked')).toBeNull();
10
- return { message: () => 'Pass', pass: true };
11
- },
12
- async toHaveValue(receiver, expected) {
13
- const actual = await receiver.evaluate((el) => el.value);
14
- const pass = actual === expected;
15
- return {
16
- pass,
17
- message: () => (pass ? `expected value not to be “${expected}”` : `expected value to be “${expected}”, but got ${actual === null ? 'no value' : `“${actual}”`}`),
18
- };
19
- },
20
- });
21
- //# sourceMappingURL=custom-matchers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-matchers.js","sourceRoot":"","sources":["../../src/playwright-util/custom-matchers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAkD,MAAM,kBAAkB,CAAC;AAEtG,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IACrC,KAAK,CAAC,SAAS,CAA2B,QAAiB;QAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,KAAK,CAAC,YAAY,CAA2B,QAAiB;QAC7D,MAAM,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,KAAK,CAAC,WAAW,CAA2B,QAAiB,EAAE,QAAgB;QAC9E,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,KAAe,CAAC,CAAC;QACrF,MAAM,IAAI,GAAG,MAAM,KAAK,QAAQ,CAAC;QACjC,OAAO;YACN,IAAI;YACJ,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,6BAA6B,QAAQ,GAAG,CAAC,CAAC,CAAC,yBAAyB,QAAQ,cAAc,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;SAChK,CAAC;IACH,CAAC;CACD,CAAC,CAAC","sourcesContent":["import { expect as pwExpect, ExpectMatcherState, Locator, MatcherReturnType } from '@playwright/test';\n\nexport const expect = pwExpect.extend({\n\tasync isChecked(this: ExpectMatcherState, receiver: Locator): Promise<MatcherReturnType> {\n\t\tconsole.log(await receiver.getAttribute('checked'));\n\t\texpect(await receiver.getAttribute('checked')).toBe('');\n\t\treturn { message: () => 'Pass', pass: true };\n\t},\n\tasync isNotChecked(this: ExpectMatcherState, receiver: Locator): Promise<MatcherReturnType> {\n\t\texpect(await receiver.getAttribute('checked')).toBeNull();\n\t\treturn { message: () => 'Pass', pass: true };\n\t},\n\tasync toHaveValue(this: ExpectMatcherState, receiver: Locator, expected: string): Promise<MatcherReturnType> {\n\t\tconst actual = await receiver.evaluate((el: HTMLInputElement) => el.value as string);\n\t\tconst pass = actual === expected;\n\t\treturn {\n\t\t\tpass,\n\t\t\tmessage: () => (pass ? `expected value not to be “${expected}”` : `expected value to be “${expected}”, but got ${actual === null ? 'no value' : `“${actual}”`}`),\n\t\t};\n\t},\n});\n"]}
@@ -1,3 +0,0 @@
1
- import { Page } from '@playwright/test';
2
- export declare const onFormSubmitCallback: (page: Page, formSelector: string) => Promise<() => Promise<Record<string, string>>>;
3
- //# sourceMappingURL=form.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/playwright-util/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,eAAO,MAAM,oBAAoB,GAChC,MAAM,IAAI,EACV,cAAc,MAAM,KAClB,OAAO,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiD/C,CAAC"}
@@ -1,44 +0,0 @@
1
- export const onFormSubmitCallback = async (page, formSelector) => {
2
- let formData = null;
3
- // Expose a callback function into the browser's context
4
- // that can call function in our context, too.
5
- // Used to receive the form data from the submission callback.
6
- await page.exposeFunction('callback', async (formDataAsJson) => {
7
- formData = JSON.parse(formDataAsJson);
8
- });
9
- await page.waitForTimeout(500);
10
- // Setup a submit listener on the form found by the formSelector.
11
- // Note that this runs in a separate browser context, so we cannot pass in
12
- // non-serializable variables, such as a function reference.
13
- const result = await page.evaluate((selector) => {
14
- const form = document.getElementById(selector);
15
- if (!(form instanceof HTMLFormElement)) {
16
- return new Error('Form to attach listeners to not found');
17
- }
18
- form.addEventListener('submit', async (event) => {
19
- event.preventDefault();
20
- const formData = new FormData(form);
21
- if ('callback' in window && typeof window.callback === 'function') {
22
- const data = Array.from(formData.keys()).reduce((acc, current) => {
23
- if (formData.getAll(current).length > 1) {
24
- return { ...acc, [current]: formData.getAll(current) };
25
- }
26
- return { ...acc, [current]: formData.get(current) };
27
- }, {});
28
- await window.callback(JSON.stringify(data));
29
- }
30
- });
31
- return true;
32
- }, formSelector);
33
- if (result instanceof Error) {
34
- throw result;
35
- }
36
- // Playwright handles the timeout and will break the loop when the test suite times out
37
- return async () => {
38
- while (!formData) {
39
- await page.waitForTimeout(100);
40
- }
41
- return formData;
42
- };
43
- };
44
- //# sourceMappingURL=form.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/playwright-util/form.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACxC,IAAU,EACV,YAAoB,EAC6B,EAAE;IACnD,IAAI,QAAQ,GAAkC,IAAI,CAAC;IACnD,wDAAwD;IACxD,8CAA8C;IAC9C,8DAA8D;IAC9D,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,cAAsB,EAAE,EAAE;QACtE,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAE/B,iEAAiE;IACjE,0EAA0E;IAC1E,4DAA4D;IAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC/C,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,CAAC,IAAI,YAAY,eAAe,CAAC,EAAE,CAAC;YACxC,OAAO,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAkB,EAAE,EAAE;YAC5D,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,UAAU,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;gBACnE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAC9C,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;oBAChB,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACzC,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;oBACxD,CAAC;oBACD,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAE,EAAE,CAAC;gBACtD,CAAC,EACD,EAA+D,CAC/D,CAAC;gBACF,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7C,CAAC;QACF,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACb,CAAC,EAAE,YAAY,CAAC,CAAC;IAEjB,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC7B,MAAM,MAAM,CAAC;IACd,CAAC;IAED,uFAAuF;IACvF,OAAO,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Page } from '@playwright/test';\n\nexport const onFormSubmitCallback = async (\n\tpage: Page,\n\tformSelector: string\n): Promise<() => Promise<Record<string, string>>> => {\n\tlet formData: Record<string, string> | null = null;\n\t// Expose a callback function into the browser's context\n\t// that can call function in our context, too.\n\t// Used to receive the form data from the submission callback.\n\tawait page.exposeFunction('callback', async (formDataAsJson: string) => {\n\t\tformData = JSON.parse(formDataAsJson);\n\t});\n\n\tawait page.waitForTimeout(500);\n\n\t// Setup a submit listener on the form found by the formSelector.\n\t// Note that this runs in a separate browser context, so we cannot pass in\n\t// non-serializable variables, such as a function reference.\n\tconst result = await page.evaluate((selector) => {\n\t\tconst form = document.getElementById(selector);\n\t\tif (!(form instanceof HTMLFormElement)) {\n\t\t\treturn new Error('Form to attach listeners to not found');\n\t\t}\n\t\tform.addEventListener('submit', async (event: SubmitEvent) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst formData = new FormData(form);\n\t\t\tif ('callback' in window && typeof window.callback === 'function') {\n\t\t\t\tconst data = Array.from(formData.keys()).reduce(\n\t\t\t\t\t(acc, current) => {\n\t\t\t\t\t\tif (formData.getAll(current).length > 1) {\n\t\t\t\t\t\t\treturn { ...acc, [current]: formData.getAll(current) };\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { ...acc, [current]: formData.get(current)! };\n\t\t\t\t\t},\n\t\t\t\t\t{} as Record<string, FormDataEntryValue | FormDataEntryValue[]>\n\t\t\t\t);\n\t\t\t\tawait window.callback(JSON.stringify(data));\n\t\t\t}\n\t\t});\n\t\treturn true;\n\t}, formSelector);\n\n\tif (result instanceof Error) {\n\t\tthrow result;\n\t}\n\n\t// Playwright handles the timeout and will break the loop when the test suite times out\n\treturn async () => {\n\t\twhile (!formData) {\n\t\t\tawait page.waitForTimeout(100);\n\t\t}\n\t\treturn formData;\n\t};\n};\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sds-button.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-button.spec.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.spec.ts"],"names":[],"mappings":""}
@@ -1,182 +0,0 @@
1
- import { test, expect } from '@playwright/test';
2
- const primaryButtonIds = [
3
- // Primary
4
- 'button-primary-large',
5
- 'button-primary-medium',
6
- 'button-primary-small',
7
- 'button-primary-disabled',
8
- 'button-primary-large-icon-before',
9
- 'button-primary-medium-icon-before',
10
- 'button-primary-small-icon-before',
11
- 'button-primary-disabled-icon-before',
12
- 'button-primary-large-icon-after',
13
- 'button-primary-medium-icon-after',
14
- 'button-primary-small-icon-after',
15
- 'button-primary-disabled-icon-after',
16
- 'button-primary-large-icon-only',
17
- 'button-primary-medium-icon-only',
18
- 'button-primary-small-icon-only',
19
- 'button-primary-disabled-icon-only',
20
- ];
21
- const secondaryButtonIds = [
22
- // Secondary
23
- 'button-secondary-large',
24
- 'button-secondary-medium',
25
- 'button-secondary-small',
26
- 'button-secondary-disabled',
27
- 'button-secondary-large-icon-before',
28
- 'button-secondary-medium-icon-before',
29
- 'button-secondary-small-icon-before',
30
- 'button-secondary-disabled-icon-before',
31
- 'button-secondary-large-icon-after',
32
- 'button-secondary-medium-icon-after',
33
- 'button-secondary-small-icon-after',
34
- 'button-secondary-disabled-icon-after',
35
- 'button-secondary-large-icon-only',
36
- 'button-secondary-medium-icon-only',
37
- 'button-secondary-small-icon-only',
38
- 'button-secondary-disabled-icon-only',
39
- ];
40
- const tertiaryButtonIds = [
41
- // Tertiary
42
- 'button-tertiary-large',
43
- 'button-tertiary-medium',
44
- 'button-tertiary-small',
45
- 'button-tertiary-disabled',
46
- 'button-tertiary-large-icon-before',
47
- 'button-tertiary-medium-icon-before',
48
- 'button-tertiary-small-icon-before',
49
- 'button-tertiary-disabled-icon-before',
50
- 'button-tertiary-large-icon-after',
51
- 'button-tertiary-medium-icon-after',
52
- 'button-tertiary-small-icon-after',
53
- 'button-tertiary-disabled-icon-after',
54
- 'button-tertiary-large-icon-only',
55
- 'button-tertiary-medium-icon-only',
56
- 'button-tertiary-small-icon-only',
57
- 'button-tertiary-disabled-icon-only',
58
- ];
59
- const criticalButtonIds = [
60
- // Critical
61
- 'button-critical-large',
62
- 'button-critical-medium',
63
- 'button-critical-small',
64
- 'button-critical-disabled',
65
- 'button-critical-large-icon-before',
66
- 'button-critical-medium-icon-before',
67
- 'button-critical-small-icon-before',
68
- 'button-critical-disabled-icon-before',
69
- 'button-critical-large-icon-after',
70
- 'button-critical-medium-icon-after',
71
- 'button-critical-small-icon-after',
72
- 'button-critical-disabled-icon-after',
73
- 'button-critical-large-icon-only',
74
- 'button-critical-medium-icon-only',
75
- 'button-critical-small-icon-only',
76
- 'button-critical-disabled-icon-only',
77
- ];
78
- const dangerButtonIds = [
79
- // Danger
80
- 'button-danger-primary-large',
81
- 'button-danger-primary-medium',
82
- 'button-danger-primary-small',
83
- 'button-danger-primary-disabled',
84
- 'button-danger-primary-large-icon-before',
85
- 'button-danger-primary-medium-icon-before',
86
- 'button-danger-primary-small-icon-before',
87
- 'button-danger-primary-disabled-icon-before',
88
- 'button-danger-primary-large-icon-after',
89
- 'button-danger-primary-medium-icon-after',
90
- 'button-danger-primary-small-icon-after',
91
- 'button-danger-primary-disabled-icon-after',
92
- 'button-danger-primary-large-icon-only',
93
- 'button-danger-primary-medium-icon-only',
94
- 'button-danger-primary-small-icon-only',
95
- 'button-danger-primary-disabled-icon-only',
96
- 'button-danger-secondary-large',
97
- 'button-danger-secondary-medium',
98
- 'button-danger-secondary-small',
99
- 'button-danger-secondary-disabled',
100
- 'button-danger-secondary-large-icon-before',
101
- 'button-danger-secondary-medium-icon-before',
102
- 'button-danger-secondary-small-icon-before',
103
- 'button-danger-secondary-disabled-icon-before',
104
- 'button-danger-secondary-large-icon-after',
105
- 'button-danger-secondary-medium-icon-after',
106
- 'button-danger-secondary-small-icon-after',
107
- 'button-danger-secondary-disabled-icon-after',
108
- 'button-danger-secondary-large-icon-only',
109
- 'button-danger-secondary-medium-icon-only',
110
- 'button-danger-secondary-small-icon-only',
111
- 'button-danger-secondary-disabled-icon-only',
112
- 'button-danger-tertiary-large',
113
- 'button-danger-tertiary-medium',
114
- 'button-danger-tertiary-small',
115
- 'button-danger-tertiary-disabled',
116
- 'button-danger-tertiary-large-icon-before',
117
- 'button-danger-tertiary-medium-icon-before',
118
- 'button-danger-tertiary-small-icon-before',
119
- 'button-danger-tertiary-disabled-icon-before',
120
- 'button-danger-tertiary-large-icon-after',
121
- 'button-danger-tertiary-medium-icon-after',
122
- 'button-danger-tertiary-small-icon-after',
123
- 'button-danger-tertiary-disabled-icon-after',
124
- 'button-danger-tertiary-large-icon-only',
125
- 'button-danger-tertiary-medium-icon-only',
126
- 'button-danger-tertiary-small-icon-only',
127
- 'button-danger-tertiary-disabled-icon-only',
128
- ];
129
- test.describe('button-component', () => {
130
- test.beforeEach(async ({ page }) => {
131
- await page.goto('iframe.html?viewMode=docs&id=test-button--docs');
132
- });
133
- test('visibility', async ({ page }) => {
134
- const buttonIds = [...primaryButtonIds, ...secondaryButtonIds, ...tertiaryButtonIds, ...criticalButtonIds, ...dangerButtonIds];
135
- for (const id of buttonIds) {
136
- await expect(page.locator(`#${id}`)).toBeVisible();
137
- }
138
- });
139
- test.skip('design-implementation', async ({ page }) => {
140
- const buttonIds = [...primaryButtonIds, ...secondaryButtonIds, ...tertiaryButtonIds, ...criticalButtonIds, ...dangerButtonIds];
141
- await page.reload();
142
- for (const id of buttonIds) {
143
- // Default state
144
- await expect(page.locator(`#${id}`)).toHaveScreenshot(`${id}.png`);
145
- // Hover state
146
- page.locator(`#${id}`).hover();
147
- await expect(page.locator(`#${id}`)).toHaveScreenshot(`${id}-hover.png`);
148
- // Focus state
149
- await page.evaluate((id) => {
150
- const element = document.getElementById(id);
151
- if (element) {
152
- const parentDiv = document.createElement('div');
153
- parentDiv.style.padding = '10px';
154
- parentDiv.style.backgroundColor = 'white';
155
- element.parentNode?.insertBefore(parentDiv, element);
156
- parentDiv.appendChild(element);
157
- }
158
- }, id);
159
- page.locator(`#${id}`).focus();
160
- const parentDiv = await page.locator(`#${id}`).locator('xpath=..');
161
- await expect(parentDiv).toHaveScreenshot(`${id}-focus.png`);
162
- }
163
- });
164
- test('form-submission', async ({ page }) => {
165
- let requestUrl;
166
- page.on('request', (request) => {
167
- if (request.url().includes('iframe.html?first-name=John')) {
168
- requestUrl = new URL(request.url());
169
- }
170
- });
171
- await page.locator('#first-name').pressSequentially('John');
172
- await page.locator('#submit-button').click();
173
- await expect(requestUrl?.searchParams.get('first-name')).toBe('John');
174
- });
175
- test('form-reset', async ({ page }) => {
176
- await page.locator('#first-name').pressSequentially('John');
177
- await page.locator('#reset-button').click();
178
- const value = await page.locator('#first-name').getAttribute('value');
179
- expect(value).toBeNull();
180
- });
181
- });
182
- //# sourceMappingURL=sds-button.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-button.spec.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,gBAAgB,GAAG;IACxB,UAAU;IACV,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,yBAAyB;IACzB,kCAAkC;IAClC,mCAAmC;IACnC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,kCAAkC;IAClC,iCAAiC;IACjC,oCAAoC;IACpC,gCAAgC;IAChC,iCAAiC;IACjC,gCAAgC;IAChC,mCAAmC;CACnC,CAAC;AACF,MAAM,kBAAkB,GAAG;IAC1B,YAAY;IACZ,wBAAwB;IACxB,yBAAyB;IACzB,wBAAwB;IACxB,2BAA2B;IAC3B,oCAAoC;IACpC,qCAAqC;IACrC,oCAAoC;IACpC,uCAAuC;IACvC,mCAAmC;IACnC,oCAAoC;IACpC,mCAAmC;IACnC,sCAAsC;IACtC,kCAAkC;IAClC,mCAAmC;IACnC,kCAAkC;IAClC,qCAAqC;CACrC,CAAC;AACF,MAAM,iBAAiB,GAAG;IACzB,WAAW;IACX,uBAAuB;IACvB,wBAAwB;IACxB,uBAAuB;IACvB,0BAA0B;IAC1B,mCAAmC;IACnC,oCAAoC;IACpC,mCAAmC;IACnC,sCAAsC;IACtC,kCAAkC;IAClC,mCAAmC;IACnC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,kCAAkC;IAClC,iCAAiC;IACjC,oCAAoC;CACpC,CAAC;AACF,MAAM,iBAAiB,GAAG;IACzB,WAAW;IACX,uBAAuB;IACvB,wBAAwB;IACxB,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Y,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\n\nconst primaryButtonIds = [\n\t// Primary\n\t'button-primary-large',\n\t'button-primary-medium',\n\t'button-primary-small',\n\t'button-primary-disabled',\n\t'button-primary-large-icon-before',\n\t'button-primary-medium-icon-before',\n\t'button-primary-small-icon-before',\n\t'button-primary-disabled-icon-before',\n\t'button-primary-large-icon-after',\n\t'button-primary-medium-icon-after',\n\t'button-primary-small-icon-after',\n\t'button-primary-disabled-icon-after',\n\t'button-primary-large-icon-only',\n\t'button-primary-medium-icon-only',\n\t'button-primary-small-icon-only',\n\t'button-primary-disabled-icon-only',\n];\nconst secondaryButtonIds = [\n\t// Secondary\n\t'button-secondary-large',\n\t'button-secondary-medium',\n\t'button-secondary-small',\n\t'button-secondary-disabled',\n\t'button-secondary-large-icon-before',\n\t'button-secondary-medium-icon-before',\n\t'button-secondary-small-icon-before',\n\t'button-secondary-disabled-icon-before',\n\t'button-secondary-large-icon-after',\n\t'button-secondary-medium-icon-after',\n\t'button-secondary-small-icon-after',\n\t'button-secondary-disabled-icon-after',\n\t'button-secondary-large-icon-only',\n\t'button-secondary-medium-icon-only',\n\t'button-secondary-small-icon-only',\n\t'button-secondary-disabled-icon-only',\n];\nconst tertiaryButtonIds = [\n\t// Tertiary\n\t'button-tertiary-large',\n\t'button-tertiary-medium',\n\t'button-tertiary-small',\n\t'button-tertiary-disabled',\n\t'button-tertiary-large-icon-before',\n\t'button-tertiary-medium-icon-before',\n\t'button-tertiary-small-icon-before',\n\t'button-tertiary-disabled-icon-before',\n\t'button-tertiary-large-icon-after',\n\t'button-tertiary-medium-icon-after',\n\t'button-tertiary-small-icon-after',\n\t'button-tertiary-disabled-icon-after',\n\t'button-tertiary-large-icon-only',\n\t'button-tertiary-medium-icon-only',\n\t'button-tertiary-small-icon-only',\n\t'button-tertiary-disabled-icon-only',\n];\nconst criticalButtonIds = [\n\t// Critical\n\t'button-critical-large',\n\t'button-critical-medium',\n\t'button-critical-small',\n\t'button-critical-disabled',\n\t'button-critical-large-icon-before',\n\t'button-critical-medium-icon-before',\n\t'button-critical-small-icon-before',\n\t'button-critical-disabled-icon-before',\n\t'button-critical-large-icon-after',\n\t'button-critical-medium-icon-after',\n\t'button-critical-small-icon-after',\n\t'button-critical-disabled-icon-after',\n\t'button-critical-large-icon-only',\n\t'button-critical-medium-icon-only',\n\t'button-critical-small-icon-only',\n\t'button-critical-disabled-icon-only',\n];\n\nconst dangerButtonIds = [\n\t// Danger\n\t'button-danger-primary-large',\n\t'button-danger-primary-medium',\n\t'button-danger-primary-small',\n\t'button-danger-primary-disabled',\n\t'button-danger-primary-large-icon-before',\n\t'button-danger-primary-medium-icon-before',\n\t'button-danger-primary-small-icon-before',\n\t'button-danger-primary-disabled-icon-before',\n\t'button-danger-primary-large-icon-after',\n\t'button-danger-primary-medium-icon-after',\n\t'button-danger-primary-small-icon-after',\n\t'button-danger-primary-disabled-icon-after',\n\t'button-danger-primary-large-icon-only',\n\t'button-danger-primary-medium-icon-only',\n\t'button-danger-primary-small-icon-only',\n\t'button-danger-primary-disabled-icon-only',\n\t'button-danger-secondary-large',\n\t'button-danger-secondary-medium',\n\t'button-danger-secondary-small',\n\t'button-danger-secondary-disabled',\n\t'button-danger-secondary-large-icon-before',\n\t'button-danger-secondary-medium-icon-before',\n\t'button-danger-secondary-small-icon-before',\n\t'button-danger-secondary-disabled-icon-before',\n\t'button-danger-secondary-large-icon-after',\n\t'button-danger-secondary-medium-icon-after',\n\t'button-danger-secondary-small-icon-after',\n\t'button-danger-secondary-disabled-icon-after',\n\t'button-danger-secondary-large-icon-only',\n\t'button-danger-secondary-medium-icon-only',\n\t'button-danger-secondary-small-icon-only',\n\t'button-danger-secondary-disabled-icon-only',\n\t'button-danger-tertiary-large',\n\t'button-danger-tertiary-medium',\n\t'button-danger-tertiary-small',\n\t'button-danger-tertiary-disabled',\n\t'button-danger-tertiary-large-icon-before',\n\t'button-danger-tertiary-medium-icon-before',\n\t'button-danger-tertiary-small-icon-before',\n\t'button-danger-tertiary-disabled-icon-before',\n\t'button-danger-tertiary-large-icon-after',\n\t'button-danger-tertiary-medium-icon-after',\n\t'button-danger-tertiary-small-icon-after',\n\t'button-danger-tertiary-disabled-icon-after',\n\t'button-danger-tertiary-large-icon-only',\n\t'button-danger-tertiary-medium-icon-only',\n\t'button-danger-tertiary-small-icon-only',\n\t'button-danger-tertiary-disabled-icon-only',\n];\n\ntest.describe('button-component', () => {\n\ttest.beforeEach(async ({ page }) => {\n\t\tawait page.goto('iframe.html?viewMode=docs&id=test-button--docs');\n\t});\n\n\ttest('visibility', async ({ page }) => {\n\t\tconst buttonIds = [...primaryButtonIds, ...secondaryButtonIds, ...tertiaryButtonIds, ...criticalButtonIds, ...dangerButtonIds];\n\n\t\tfor (const id of buttonIds) {\n\t\t\tawait expect(page.locator(`#${id}`)).toBeVisible();\n\t\t}\n\t});\n\n\ttest.skip('design-implementation', async ({ page }) => {\n\t\tconst buttonIds = [...primaryButtonIds, ...secondaryButtonIds, ...tertiaryButtonIds, ...criticalButtonIds, ...dangerButtonIds];\n\t\tawait page.reload();\n\n\t\tfor (const id of buttonIds) {\n\t\t\t// Default state\n\t\t\tawait expect(page.locator(`#${id}`)).toHaveScreenshot(`${id}.png`);\n\t\t\t// Hover state\n\t\t\tpage.locator(`#${id}`).hover();\n\t\t\tawait expect(page.locator(`#${id}`)).toHaveScreenshot(`${id}-hover.png`);\n\t\t\t// Focus state\n\t\t\tawait page.evaluate((id) => {\n\t\t\t\tconst element = document.getElementById(id);\n\t\t\t\tif (element) {\n\t\t\t\t\tconst parentDiv = document.createElement('div');\n\t\t\t\t\tparentDiv.style.padding = '10px';\n\t\t\t\t\tparentDiv.style.backgroundColor = 'white';\n\t\t\t\t\telement.parentNode?.insertBefore(parentDiv, element);\n\t\t\t\t\tparentDiv.appendChild(element);\n\t\t\t\t}\n\t\t\t}, id);\n\t\t\tpage.locator(`#${id}`).focus();\n\t\t\tconst parentDiv = await page.locator(`#${id}`).locator('xpath=..');\n\t\t\tawait expect(parentDiv).toHaveScreenshot(`${id}-focus.png`);\n\t\t}\n\t});\n\n\ttest('form-submission', async ({ page }) => {\n\t\tlet requestUrl: URL | undefined;\n\t\tpage.on('request', (request) => {\n\t\t\tif (request.url().includes('iframe.html?first-name=John')) {\n\t\t\t\trequestUrl = new URL(request.url());\n\t\t\t}\n\t\t});\n\n\t\tawait page.locator('#first-name').pressSequentially('John');\n\t\tawait page.locator('#submit-button').click();\n\t\tawait expect(requestUrl?.searchParams.get('first-name')).toBe('John');\n\t});\n\n\ttest('form-reset', async ({ page }) => {\n\t\tawait page.locator('#first-name').pressSequentially('John');\n\t\tawait page.locator('#reset-button').click();\n\t\tconst value = await page.locator('#first-name').getAttribute('value');\n\t\texpect(value).toBeNull();\n\t});\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sds-checkbox.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-checkbox.spec.d.ts","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.spec.ts"],"names":[],"mappings":""}
@@ -1,74 +0,0 @@
1
- import { test } from '@playwright/test';
2
- import { onFormSubmitCallback } from '../playwright-util/form';
3
- import { expect } from '../playwright-util/custom-matchers';
4
- test.describe('checkbox-component', () => {
5
- test.beforeEach(async ({ page }) => {
6
- await page.goto('iframe.html?viewMode=docs&id=test-checkbox--docs');
7
- });
8
- test('visibility', async ({ page }) => {
9
- await expect(page.locator('#with-label')).toBeVisible();
10
- await expect(page.locator('#unchecked')).toBeVisible();
11
- await expect(page.locator('#checked')).toBeVisible();
12
- await expect(page.locator('#custom-value')).toBeVisible();
13
- await expect(page.locator('#disabled')).toBeVisible();
14
- await expect(page.locator('#checked-disabled')).toBeVisible();
15
- });
16
- test('states', async ({ page }) => {
17
- const checkboxWithLabel = page.locator('#with-label');
18
- await expect(checkboxWithLabel).isNotChecked();
19
- const uncheckedCheckbox = page.locator('#unchecked');
20
- await expect(uncheckedCheckbox).isNotChecked();
21
- const checkedCheckbox = page.locator('#checked');
22
- await expect(checkedCheckbox).isChecked();
23
- const disabledCheckbox = page.locator('#disabled');
24
- await expect(disabledCheckbox).toHaveAttribute('disabled', '');
25
- const checkedDisabledCheckbox = page.locator('#checked-disabled');
26
- await expect(checkedDisabledCheckbox).isChecked();
27
- await expect(checkedDisabledCheckbox).toHaveAttribute('disabled', '');
28
- });
29
- test('interaction', async ({ page }) => {
30
- await page.getByLabel('Checkbox with label').click();
31
- const checkboxWithLabel = page.locator('#with-label');
32
- await expect(checkboxWithLabel).isChecked();
33
- const uncheckedCheckbox = page.locator('#unchecked');
34
- await uncheckedCheckbox.click();
35
- await expect(uncheckedCheckbox).isChecked();
36
- const checkedCheckbox = page.locator('#checked');
37
- await checkedCheckbox.click();
38
- await expect(checkedCheckbox).isNotChecked();
39
- const disabledCheckbox = page.locator('#disabled');
40
- await disabledCheckbox.click();
41
- await expect(checkedCheckbox).isNotChecked();
42
- const checkedDisabledCheckbox = page.locator('#checked-disabled');
43
- await checkedDisabledCheckbox.click();
44
- await expect(checkedDisabledCheckbox).isChecked();
45
- });
46
- test('form-submission', async ({ page }) => {
47
- const getFormData = await onFormSubmitCallback(page, 'checkbox-form');
48
- const checkboxGroupMember = page.locator('#group-member-1');
49
- await checkboxGroupMember.click();
50
- const checkboxGroupMember2 = page.locator('#group-member-2');
51
- await checkboxGroupMember2.click();
52
- const checkboxGroupMember3 = page.locator('#group-member-3');
53
- await checkboxGroupMember3.click();
54
- await page.locator('#submit-button').click();
55
- await expect.poll(async () => (await getFormData()) !== null, 'Form data not received').toBeTruthy();
56
- const formData = await getFormData();
57
- expect(formData).toMatchObject({
58
- checked: 'on',
59
- 'custom-value': 'custom-value',
60
- 'checkbox-group': ['option-1', 'option-2', 'option-3'],
61
- });
62
- expect(formData).not.toHaveProperty('unchecked');
63
- expect(formData).not.toHaveProperty('disabled');
64
- expect(formData).not.toHaveProperty('checked-disabled');
65
- });
66
- test('form-reset', async ({ page }) => {
67
- await page.locator('#unchecked').click();
68
- await page.locator('#checked').click();
69
- await page.locator('#reset-button').click();
70
- await expect(page.locator('#unchecked')).isNotChecked();
71
- await expect(page.locator('#checked')).isChecked();
72
- });
73
- });
74
- //# sourceMappingURL=sds-checkbox.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-checkbox.spec.js","sourceRoot":"","sources":["../../src/sds-checkbox/sds-checkbox.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACxC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,IAAI,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,MA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AI,EAAE,EAAE,EAAE;QACrC,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;QACzC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;QAEvC,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC;QAE5C,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QACxD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { test } from '@playwright/test';\nimport { onFormSubmitCallback } from '../playwright-util/form';\nimport { expect } from '../playwright-util/custom-matchers';\n\ntest.describe('checkbox-component', () => {\n\ttest.beforeEach(async ({ page }) => {\n\t\tawait page.goto('iframe.html?viewMode=docs&id=test-checkbox--docs');\n\t});\n\n\ttest('visibility', async ({ page }) => {\n\t\tawait expect(page.locator('#with-label')).toBeVisible();\n\t\tawait expect(page.locator('#unchecked')).toBeVisible();\n\t\tawait expect(page.locator('#checked')).toBeVisible();\n\t\tawait expect(page.locator('#custom-value')).toBeVisible();\n\t\tawait expect(page.locator('#disabled')).toBeVisible();\n\t\tawait expect(page.locator('#checked-disabled')).toBeVisible();\n\t});\n\n\ttest('states', async ({ page }) => {\n\t\tconst checkboxWithLabel = page.locator('#with-label');\n\t\tawait expect(checkboxWithLabel).isNotChecked();\n\n\t\tconst uncheckedCheckbox = page.locator('#unchecked');\n\t\tawait expect(uncheckedCheckbox).isNotChecked();\n\n\t\tconst checkedCheckbox = page.locator('#checked');\n\t\tawait expect(checkedCheckbox).isChecked();\n\n\t\tconst disabledCheckbox = page.locator('#disabled');\n\t\tawait expect(disabledCheckbox).toHaveAttribute('disabled', '');\n\n\t\tconst checkedDisabledCheckbox = page.locator('#checked-disabled');\n\t\tawait expect(checkedDisabledCheckbox).isChecked();\n\t\tawait expect(checkedDisabledCheckbox).toHaveAttribute('disabled', '');\n\t});\n\n\ttest('interaction', async ({ page }) => {\n\t\tawait page.getByLabel('Checkbox with label').click();\n\t\tconst checkboxWithLabel = page.locator('#with-label');\n\t\tawait expect(checkboxWithLabel).isChecked();\n\n\t\tconst uncheckedCheckbox = page.locator('#unchecked');\n\t\tawait uncheckedCheckbox.click();\n\t\tawait expect(uncheckedCheckbox).isChecked();\n\n\t\tconst checkedCheckbox = page.locator('#checked');\n\t\tawait checkedCheckbox.click();\n\t\tawait expect(checkedCheckbox).isNotChecked();\n\n\t\tconst disabledCheckbox = page.locator('#disabled');\n\t\tawait disabledCheckbox.click();\n\t\tawait expect(checkedCheckbox).isNotChecked();\n\n\t\tconst checkedDisabledCheckbox = page.locator('#checked-disabled');\n\t\tawait checkedDisabledCheckbox.click();\n\t\tawait expect(checkedDisabledCheckbox).isChecked();\n\t});\n\n\ttest('form-submission', async ({ page }) => {\n\t\tconst getFormData = await onFormSubmitCallback(page, 'checkbox-form');\n\n\t\tconst checkboxGroupMember = page.locator('#group-member-1');\n\t\tawait checkboxGroupMember.click();\n\n\t\tconst checkboxGroupMember2 = page.locator('#group-member-2');\n\t\tawait checkboxGroupMember2.click();\n\n\t\tconst checkboxGroupMember3 = page.locator('#group-member-3');\n\t\tawait checkboxGroupMember3.click();\n\n\t\tawait page.locator('#submit-button').click();\n\n\t\tawait expect.poll(async () => (await getFormData()) !== null, 'Form data not received').toBeTruthy();\n\t\tconst formData = await getFormData();\n\n\t\texpect(formData).toMatchObject({\n\t\t\tchecked: 'on',\n\t\t\t'custom-value': 'custom-value',\n\t\t\t'checkbox-group': ['option-1', 'option-2', 'option-3'],\n\t\t});\n\t\texpect(formData).not.toHaveProperty('unchecked');\n\t\texpect(formData).not.toHaveProperty('disabled');\n\t\texpect(formData).not.toHaveProperty('checked-disabled');\n\t});\n\n\ttest('form-reset', async ({ page }) => {\n\t\tawait page.locator('#unchecked').click();\n\t\tawait page.locator('#checked').click();\n\n\t\tawait page.locator('#reset-button').click();\n\n\t\tawait expect(page.locator('#unchecked')).isNotChecked();\n\t\tawait expect(page.locator('#checked')).isChecked();\n\t});\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sds-dialog.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-dialog.spec.d.ts","sourceRoot":"","sources":["../../src/sds-dialog/sds-dialog.spec.ts"],"names":[],"mappings":""}
@@ -1,64 +0,0 @@
1
- import { test, expect } from '@playwright/test';
2
- test.describe('dialog-component', () => {
3
- test.beforeEach(async ({ page }) => {
4
- await page.goto('iframe.html?viewMode=docs&id=test-dialog--docs');
5
- await page.evaluate(async () => {
6
- await customElements.whenDefined('sds-dialog');
7
- });
8
- });
9
- test.describe('commandfor', () => {
10
- test('sets aria-haspopup on the trigger button', async ({ page }) => {
11
- const innerButton = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]').locator('button');
12
- await expect(innerButton).toHaveAttribute('aria-haspopup', 'dialog');
13
- });
14
- test('sets aria-controls on the trigger button', async ({ page }) => {
15
- const innerButton = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]').locator('button');
16
- await expect(innerButton).toHaveAttribute('aria-controls', 'dialog-example');
17
- });
18
- test('aria-expanded is false before opening', async ({ page }) => {
19
- const innerButton = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]').locator('button');
20
- await expect(innerButton).toHaveAttribute('aria-expanded', 'false');
21
- });
22
- test('clicking the trigger opens the dialog', async ({ page }) => {
23
- const trigger = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]');
24
- const dialog = page.locator('sds-dialog#dialog-example');
25
- await trigger.click();
26
- await expect(dialog).toHaveAttribute('open');
27
- });
28
- test('aria-expanded is true when dialog is open', async ({ page }) => {
29
- const trigger = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]');
30
- const innerButton = trigger.locator('button');
31
- await trigger.click();
32
- await expect(innerButton).toHaveAttribute('aria-expanded', 'true');
33
- });
34
- test('closing via command="close" resets aria-expanded', async ({ page }) => {
35
- const trigger = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]');
36
- const innerButton = trigger.locator('button');
37
- await trigger.click();
38
- await expect(innerButton).toHaveAttribute('aria-expanded', 'true');
39
- const closeButton = page.locator('sds-dialog#dialog-example sds-button[slot="footer"][command="close"]');
40
- await closeButton.click();
41
- await expect(innerButton).toHaveAttribute('aria-expanded', 'false');
42
- });
43
- test('closing via ESC resets aria-expanded', async ({ page }) => {
44
- const trigger = page.locator('sds-button[commandfor="dialog-example"][command="show-modal"]');
45
- const innerButton = trigger.locator('button');
46
- await trigger.click();
47
- await expect(innerButton).toHaveAttribute('aria-expanded', 'true');
48
- await page.keyboard.press('Escape');
49
- await expect(innerButton).toHaveAttribute('aria-expanded', 'false');
50
- });
51
- });
52
- test.describe('also supports data-command', () => {
53
- test('can open and close using data-command', async ({ page }) => {
54
- const opener = page.locator('sds-button#trigger-data');
55
- const closer = page.locator('sds-button#close-data');
56
- const dialog = page.locator('sds-dialog#command-fixture-dialog');
57
- await opener.click();
58
- await expect(dialog).toHaveAttribute('open');
59
- await closer.click();
60
- await expect(dialog).not.toHaveAttribute('open');
61
- });
62
- });
63
- });
64
- //# sourceMappingURL=sds-dialog.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-dialog.spec.js","sourceRoot":"","sources":["../../src/sds-dialog/sds-dialog.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACtC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,IAAI,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAElE,MAAM,IAA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,CAAC,CAAC;YAC9F,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAE9C,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YACtB,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;YAEnE,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAEpC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,eAAe,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAChD,IAAI,CAAC,uCAAuC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAChE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;YAEjE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAE7C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\n\ntest.describe('dialog-component', () => {\n\ttest.beforeEach(async ({ page }) => {\n\t\tawait page.goto('iframe.html?viewMode=docs&id=test-dialog--docs');\n\n\t\tawait page.evaluate(async () => {\n\t\t\tawait customElements.whenDefined('sds-dialog');\n\t\t});\n\t});\n\n\ttest.describe('commandfor', () => {\n\t\ttest('sets aria-haspopup on the trigger button', async ({ page }) => {\n\t\t\tconst innerButton = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]').locator('button');\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-haspopup', 'dialog');\n\t\t});\n\n\t\ttest('sets aria-controls on the trigger button', async ({ page }) => {\n\t\t\tconst innerButton = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]').locator('button');\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-controls', 'dialog-example');\n\t\t});\n\n\t\ttest('aria-expanded is false before opening', async ({ page }) => {\n\t\t\tconst innerButton = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]').locator('button');\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'false');\n\t\t});\n\n\t\ttest('clicking the trigger opens the dialog', async ({ page }) => {\n\t\t\tconst trigger = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]');\n\t\t\tconst dialog = page.locator('sds-dialog#dialog-example');\n\n\t\t\tawait trigger.click();\n\n\t\t\tawait expect(dialog).toHaveAttribute('open');\n\t\t});\n\n\t\ttest('aria-expanded is true when dialog is open', async ({ page }) => {\n\t\t\tconst trigger = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]');\n\t\t\tconst innerButton = trigger.locator('button');\n\n\t\t\tawait trigger.click();\n\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'true');\n\t\t});\n\n\t\ttest('closing via command=\"close\" resets aria-expanded', async ({ page }) => {\n\t\t\tconst trigger = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]');\n\t\t\tconst innerButton = trigger.locator('button');\n\n\t\t\tawait trigger.click();\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'true');\n\n\t\t\tconst closeButton = page.locator('sds-dialog#dialog-example sds-button[slot=\"footer\"][command=\"close\"]');\n\t\t\tawait closeButton.click();\n\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'false');\n\t\t});\n\n\t\ttest('closing via ESC resets aria-expanded', async ({ page }) => {\n\t\t\tconst trigger = page.locator('sds-button[commandfor=\"dialog-example\"][command=\"show-modal\"]');\n\t\t\tconst innerButton = trigger.locator('button');\n\n\t\t\tawait trigger.click();\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'true');\n\n\t\t\tawait page.keyboard.press('Escape');\n\n\t\t\tawait expect(innerButton).toHaveAttribute('aria-expanded', 'false');\n\t\t});\n\t});\n\n\ttest.describe('also supports data-command', () => {\n\t\ttest('can open and close using data-command', async ({ page }) => {\n\t\t\tconst opener = page.locator('sds-button#trigger-data');\n\t\t\tconst closer = page.locator('sds-button#close-data');\n\t\t\tconst dialog = page.locator('sds-dialog#command-fixture-dialog');\n\n\t\t\tawait opener.click();\n\t\t\tawait expect(dialog).toHaveAttribute('open');\n\n\t\t\tawait closer.click();\n\t\t\tawait expect(dialog).not.toHaveAttribute('open');\n\t\t});\n\t});\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sds-radio.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-radio.spec.d.ts","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.spec.ts"],"names":[],"mappings":""}
@@ -1,71 +0,0 @@
1
- import { test } from '@playwright/test';
2
- import { onFormSubmitCallback } from '../playwright-util/form';
3
- import { expect } from '../playwright-util/custom-matchers';
4
- test.describe('radio-component', () => {
5
- test.beforeEach(async ({ page }) => {
6
- await page.goto('iframe.html?viewMode=docs&id=test-radio--docs');
7
- });
8
- test('visibility', async ({ page }) => {
9
- await expect(page.locator('#with-label')).toBeVisible();
10
- await expect(page.locator('#unchecked')).toBeVisible();
11
- await expect(page.locator('#checked')).toBeVisible();
12
- await expect(page.locator('#custom-value')).toBeVisible();
13
- await expect(page.locator('#disabled')).toBeVisible();
14
- await expect(page.locator('#checked-disabled')).toBeVisible();
15
- });
16
- test('states', async ({ page }) => {
17
- const radioWithLabel = page.locator('#with-label');
18
- await expect(radioWithLabel).isNotChecked();
19
- const uncheckedRadio = page.locator('#unchecked');
20
- await expect(uncheckedRadio).isNotChecked();
21
- const checkedRadio = page.locator('#checked');
22
- await expect(checkedRadio).isChecked();
23
- const disabledRadio = page.locator('#disabled');
24
- await expect(disabledRadio).toHaveAttribute('disabled', '');
25
- const checkedDisabledRadio = page.locator('#checked-disabled');
26
- await expect(checkedDisabledRadio).isChecked();
27
- await expect(checkedDisabledRadio).toHaveAttribute('disabled', '');
28
- });
29
- test('interaction', async ({ page }) => {
30
- await page.getByLabel('Radio button with label').click();
31
- const radioWithLabel = page.locator('#with-label');
32
- await expect(radioWithLabel).isChecked();
33
- const uncheckedRadio = page.locator('#unchecked');
34
- await uncheckedRadio.click();
35
- await expect(uncheckedRadio).isChecked();
36
- const disabledRadio = page.locator('#disabled');
37
- await disabledRadio.click();
38
- await expect(disabledRadio).isNotChecked();
39
- const checkedDisabledRadio = page.locator('#checked-disabled');
40
- await checkedDisabledRadio.click();
41
- await expect(checkedDisabledRadio).isChecked();
42
- });
43
- test('form-submission', async ({ page }) => {
44
- const getFormData = await onFormSubmitCallback(page, 'radio-form');
45
- const radioGroupMember = page.locator('#group-member-1');
46
- await radioGroupMember.click();
47
- const radioGroupMember2 = page.locator('#group-member-2');
48
- await radioGroupMember2.click();
49
- const radioGroupMember3 = page.locator('#group-member-3');
50
- await radioGroupMember3.click();
51
- await page.locator('#submit-button').click();
52
- await expect.poll(async () => (await getFormData()) !== null, 'Form data not received').toBeTruthy();
53
- const formData = await getFormData();
54
- expect(formData).toMatchObject({
55
- checked: 'on',
56
- 'custom-value': 'custom-value',
57
- 'radio-group': 'option-3',
58
- });
59
- expect(formData).not.toHaveProperty('unchecked');
60
- expect(formData).not.toHaveProperty('disabled');
61
- expect(formData).not.toHaveProperty('checked-disabled');
62
- });
63
- test('form-reset', async ({ page }) => {
64
- await page.locator('#unchecked').click();
65
- await page.locator('#checked').click();
66
- await page.locator('#reset-button').click();
67
- await expect(page.locator('#unchecked')).isNotChecked();
68
- await expect(page.locator('#checked')).isChecked();
69
- });
70
- });
71
- //# sourceMappingURL=sds-radio.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sds-radio.spec.js","sourceRoot":"","sources":["../../src/sds-radio/sds-radio.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACrC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAClC,MAAM,IAAI,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACxD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACvD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACrD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1D,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACtD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CA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G,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;QAErC,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;YAC9B,OAAO,EAAE,IAAI;YACb,cAAc,EAAE,cAAc;YAC9B,aAAa,EAAE,UAAU;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACjD,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAChD,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACrC,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;QACzC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;QAEvC,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC;QAE5C,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;QACxD,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { test } from '@playwright/test';\nimport { onFormSubmitCallback } from '../playwright-util/form';\nimport { expect } from '../playwright-util/custom-matchers';\n\ntest.describe('radio-component', () => {\n\ttest.beforeEach(async ({ page }) => {\n\t\tawait page.goto('iframe.html?viewMode=docs&id=test-radio--docs');\n\t});\n\n\ttest('visibility', async ({ page }) => {\n\t\tawait expect(page.locator('#with-label')).toBeVisible();\n\t\tawait expect(page.locator('#unchecked')).toBeVisible();\n\t\tawait expect(page.locator('#checked')).toBeVisible();\n\t\tawait expect(page.locator('#custom-value')).toBeVisible();\n\t\tawait expect(page.locator('#disabled')).toBeVisible();\n\t\tawait expect(page.locator('#checked-disabled')).toBeVisible();\n\t});\n\n\ttest('states', async ({ page }) => {\n\t\tconst radioWithLabel = page.locator('#with-label');\n\t\tawait expect(radioWithLabel).isNotChecked();\n\n\t\tconst uncheckedRadio = page.locator('#unchecked');\n\t\tawait expect(uncheckedRadio).isNotChecked();\n\n\t\tconst checkedRadio = page.locator('#checked');\n\t\tawait expect(checkedRadio).isChecked();\n\n\t\tconst disabledRadio = page.locator('#disabled');\n\t\tawait expect(disabledRadio).toHaveAttribute('disabled', '');\n\n\t\tconst checkedDisabledRadio = page.locator('#checked-disabled');\n\t\tawait expect(checkedDisabledRadio).isChecked();\n\t\tawait expect(checkedDisabledRadio).toHaveAttribute('disabled', '');\n\t});\n\n\ttest('interaction', async ({ page }) => {\n\t\tawait page.getByLabel('Radio button with label').click();\n\t\tconst radioWithLabel = page.locator('#with-label');\n\t\tawait expect(radioWithLabel).isChecked();\n\n\t\tconst uncheckedRadio = page.locator('#unchecked');\n\t\tawait uncheckedRadio.click();\n\t\tawait expect(uncheckedRadio).isChecked();\n\n\t\tconst disabledRadio = page.locator('#disabled');\n\t\tawait disabledRadio.click();\n\t\tawait expect(disabledRadio).isNotChecked();\n\n\t\tconst checkedDisabledRadio = page.locator('#checked-disabled');\n\t\tawait checkedDisabledRadio.click();\n\t\tawait expect(checkedDisabledRadio).isChecked();\n\t});\n\n\ttest('form-submission', async ({ page }) => {\n\t\tconst getFormData = await onFormSubmitCallback(page, 'radio-form');\n\n\t\tconst radioGroupMember = page.locator('#group-member-1');\n\t\tawait radioGroupMember.click();\n\n\t\tconst radioGroupMember2 = page.locator('#group-member-2');\n\t\tawait radioGroupMember2.click();\n\n\t\tconst radioGroupMember3 = page.locator('#group-member-3');\n\t\tawait radioGroupMember3.click();\n\n\t\tawait page.locator('#submit-button').click();\n\n\t\tawait expect.poll(async () => (await getFormData()) !== null, 'Form data not received').toBeTruthy();\n\t\tconst formData = await getFormData();\n\n\t\texpect(formData).toMatchObject({\n\t\t\tchecked: 'on',\n\t\t\t'custom-value': 'custom-value',\n\t\t\t'radio-group': 'option-3',\n\t\t});\n\t\texpect(formData).not.toHaveProperty('unchecked');\n\t\texpect(formData).not.toHaveProperty('disabled');\n\t\texpect(formData).not.toHaveProperty('checked-disabled');\n\t});\n\n\ttest('form-reset', async ({ page }) => {\n\t\tawait page.locator('#unchecked').click();\n\t\tawait page.locator('#checked').click();\n\n\t\tawait page.locator('#reset-button').click();\n\n\t\tawait expect(page.locator('#unchecked')).isNotChecked();\n\t\tawait expect(page.locator('#checked')).isChecked();\n\t});\n});\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sds-textfield.spec.d.ts.map