@politiet/sheriff-web-components 2.7.1 → 2.8.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.
Files changed (100) hide show
  1. package/custom-elements.json +80 -8
  2. package/dist/mixins/sds-dialog-target-mixin.d.ts.map +1 -1
  3. package/dist/mixins/sds-dialog-target-mixin.js +4 -2
  4. package/dist/mixins/sds-dialog-target-mixin.js.map +1 -1
  5. package/dist/mixins/sds-form-control-mixin.d.ts +1 -0
  6. package/dist/mixins/sds-form-control-mixin.d.ts.map +1 -1
  7. package/dist/mixins/sds-form-control-mixin.js +7 -0
  8. package/dist/mixins/sds-form-control-mixin.js.map +1 -1
  9. package/dist/mixins/sds-popover-target-mixin.d.ts +1 -1
  10. package/dist/mixins/sds-popover-target-mixin.d.ts.map +1 -1
  11. package/dist/mixins/sds-popover-target-mixin.js.map +1 -1
  12. package/dist/sds-button/sds-button.component.d.ts +3 -1
  13. package/dist/sds-button/sds-button.component.d.ts.map +1 -1
  14. package/dist/sds-button/sds-button.component.js +5 -1
  15. package/dist/sds-button/sds-button.component.js.map +1 -1
  16. package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
  17. package/dist/sds-button/sds-button.styles.js +87 -3
  18. package/dist/sds-button/sds-button.styles.js.map +1 -1
  19. package/dist/sds-card/sds-card.styles.d.ts.map +1 -1
  20. package/dist/sds-card/sds-card.styles.js +9 -3
  21. package/dist/sds-card/sds-card.styles.js.map +1 -1
  22. package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -1
  23. package/dist/sds-checkbox/sds-checkbox.styles.js +4 -2
  24. package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -1
  25. package/dist/sds-details/sds-details.styles.js +6 -6
  26. package/dist/sds-details/sds-details.styles.js.map +1 -1
  27. package/dist/sds-dialog/sds-dialog.styles.d.ts.map +1 -1
  28. package/dist/sds-dialog/sds-dialog.styles.js +8 -2
  29. package/dist/sds-dialog/sds-dialog.styles.js.map +1 -1
  30. package/dist/sds-popover/assets/popover-styles.d.ts.map +1 -1
  31. package/dist/sds-popover/assets/popover-styles.js +1 -1
  32. package/dist/sds-popover/assets/popover-styles.js.map +1 -1
  33. package/dist/sds-radio/sds-radio.styles.d.ts.map +1 -1
  34. package/dist/sds-radio/sds-radio.styles.js +10 -3
  35. package/dist/sds-radio/sds-radio.styles.js.map +1 -1
  36. package/dist/sds-select/sds-select.component.d.ts +1 -1
  37. package/dist/sds-select/sds-select.component.d.ts.map +1 -1
  38. package/dist/sds-select/sds-select.component.js +2 -1
  39. package/dist/sds-select/sds-select.component.js.map +1 -1
  40. package/dist/sds-select/sds-select.styles.d.ts.map +1 -1
  41. package/dist/sds-select/sds-select.styles.js +3 -2
  42. package/dist/sds-select/sds-select.styles.js.map +1 -1
  43. package/dist/sds-stepper-step/sds-stepper-step.styles.d.ts.map +1 -1
  44. package/dist/sds-stepper-step/sds-stepper-step.styles.js +4 -3
  45. package/dist/sds-stepper-step/sds-stepper-step.styles.js.map +1 -1
  46. package/dist/sds-switch/sds-switch.styles.js +6 -6
  47. package/dist/sds-switch/sds-switch.styles.js.map +1 -1
  48. package/dist/sds-text/sds-text.styles.d.ts.map +1 -1
  49. package/dist/sds-text/sds-text.styles.js +2 -1
  50. package/dist/sds-text/sds-text.styles.js.map +1 -1
  51. package/dist/sds-textarea/sds-textarea.d.ts +1 -1
  52. package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
  53. package/dist/sds-textarea/sds-textarea.js +6 -1
  54. package/dist/sds-textarea/sds-textarea.js.map +1 -1
  55. package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -1
  56. package/dist/sds-textarea/sds-textarea.styles.js +11 -3
  57. package/dist/sds-textarea/sds-textarea.styles.js.map +1 -1
  58. package/dist/sds-textfield/sds-textfield.d.ts +5 -1
  59. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  60. package/dist/sds-textfield/sds-textfield.js +27 -10
  61. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  62. package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
  63. package/dist/sds-textfield/sds-textfield.styles.js +4 -3
  64. package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
  65. package/dist/shared/assets/positioning.js +1 -1
  66. package/dist/sheriff-web-components.js +294 -175
  67. package/package.json +2 -2
  68. package/web-types.json +102 -10
  69. package/dist/playwright-util/custom-matchers.d.ts +0 -7
  70. package/dist/playwright-util/custom-matchers.d.ts.map +0 -1
  71. package/dist/playwright-util/custom-matchers.js +0 -21
  72. package/dist/playwright-util/custom-matchers.js.map +0 -1
  73. package/dist/playwright-util/form.d.ts +0 -3
  74. package/dist/playwright-util/form.d.ts.map +0 -1
  75. package/dist/playwright-util/form.js +0 -44
  76. package/dist/playwright-util/form.js.map +0 -1
  77. package/dist/sds-button/sds-button.spec.d.ts +0 -2
  78. package/dist/sds-button/sds-button.spec.d.ts.map +0 -1
  79. package/dist/sds-button/sds-button.spec.js +0 -182
  80. package/dist/sds-button/sds-button.spec.js.map +0 -1
  81. package/dist/sds-checkbox/sds-checkbox.spec.d.ts +0 -2
  82. package/dist/sds-checkbox/sds-checkbox.spec.d.ts.map +0 -1
  83. package/dist/sds-checkbox/sds-checkbox.spec.js +0 -74
  84. package/dist/sds-checkbox/sds-checkbox.spec.js.map +0 -1
  85. package/dist/sds-dialog/sds-dialog.spec.d.ts +0 -2
  86. package/dist/sds-dialog/sds-dialog.spec.d.ts.map +0 -1
  87. package/dist/sds-dialog/sds-dialog.spec.js +0 -64
  88. package/dist/sds-dialog/sds-dialog.spec.js.map +0 -1
  89. package/dist/sds-radio/sds-radio.spec.d.ts +0 -2
  90. package/dist/sds-radio/sds-radio.spec.d.ts.map +0 -1
  91. package/dist/sds-radio/sds-radio.spec.js +0 -71
  92. package/dist/sds-radio/sds-radio.spec.js.map +0 -1
  93. package/dist/sds-textfield/sds-textfield.spec.d.ts +0 -2
  94. package/dist/sds-textfield/sds-textfield.spec.d.ts.map +0 -1
  95. package/dist/sds-textfield/sds-textfield.spec.js +0 -137
  96. package/dist/sds-textfield/sds-textfield.spec.js.map +0 -1
  97. package/dist/sds-tooltip/sds-tooltip.spec.d.ts +0 -2
  98. package/dist/sds-tooltip/sds-tooltip.spec.d.ts.map +0 -1
  99. package/dist/sds-tooltip/sds-tooltip.spec.js +0 -35
  100. package/dist/sds-tooltip/sds-tooltip.spec.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politiet/sheriff-web-components",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "Sheriff Design System Web Components Library",
5
5
  "author": "Politiets IT-enhet",
6
6
  "license": "ISC",
@@ -171,7 +171,7 @@
171
171
  "@politiet/sheriff-icons": "^2.0.2"
172
172
  },
173
173
  "peerDependencies": {
174
- "@politiet/sheriff-css-framework": "^2.3.1",
174
+ "@politiet/sheriff-css-framework": "^2.3.2",
175
175
  "typescript": ">=3.8.0"
176
176
  },
177
177
  "peerDependenciesMeta": {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "name": "@politiet/sheriff-web-components",
4
- "version": "2.7.1",
4
+ "version": "2.8.0",
5
5
  "framework": "web-components",
6
6
  "description-markup": "markdown",
7
7
  "contributions": {
@@ -258,6 +258,20 @@
258
258
  "symbol": "SDSButton.icon"
259
259
  }
260
260
  },
261
+ {
262
+ "name": "inverted",
263
+ "required": false,
264
+ "priority": "normal",
265
+ "value": {
266
+ "type": "boolean",
267
+ "required": false,
268
+ "default": "false"
269
+ },
270
+ "source": {
271
+ "module": "./src/sds-button/sds-button.ts",
272
+ "symbol": "SDSButton.inverted"
273
+ }
274
+ },
261
275
  {
262
276
  "name": "loading",
263
277
  "required": false,
@@ -494,10 +508,8 @@
494
508
  "required": false,
495
509
  "priority": "normal",
496
510
  "value": {
497
- "type": [
498
- "string",
499
- "undefined"
500
- ],
511
+ "kind": "plain",
512
+ "type": "\"hide\" | \"show\" | \"toggle\" | undefined",
501
513
  "required": true
502
514
  },
503
515
  "source": {
@@ -578,6 +590,20 @@
578
590
  "symbol": "SDSButton.icon"
579
591
  }
580
592
  },
593
+ {
594
+ "name": "inverted",
595
+ "required": false,
596
+ "priority": "normal",
597
+ "value": {
598
+ "type": "boolean",
599
+ "required": false,
600
+ "default": "false"
601
+ },
602
+ "source": {
603
+ "module": "./src/sds-button/sds-button.ts",
604
+ "symbol": "SDSButton.inverted"
605
+ }
606
+ },
581
607
  {
582
608
  "name": "loading",
583
609
  "required": false,
@@ -918,10 +944,8 @@
918
944
  "required": false,
919
945
  "priority": "normal",
920
946
  "value": {
921
- "type": [
922
- "string",
923
- "undefined"
924
- ],
947
+ "kind": "plain",
948
+ "type": "\"hide\" | \"show\" | \"toggle\" | undefined",
925
949
  "required": true
926
950
  },
927
951
  "source": {
@@ -7077,6 +7101,40 @@
7077
7101
  "symbol": "SDSTextField.maxlength"
7078
7102
  }
7079
7103
  },
7104
+ {
7105
+ "name": "min",
7106
+ "required": false,
7107
+ "priority": "normal",
7108
+ "value": {
7109
+ "type": [
7110
+ "string",
7111
+ "number",
7112
+ "undefined"
7113
+ ],
7114
+ "required": true
7115
+ },
7116
+ "source": {
7117
+ "module": "./src/sds-textfield/sds-textfield.ts",
7118
+ "symbol": "SDSTextField.min"
7119
+ }
7120
+ },
7121
+ {
7122
+ "name": "max",
7123
+ "required": false,
7124
+ "priority": "normal",
7125
+ "value": {
7126
+ "type": [
7127
+ "string",
7128
+ "number",
7129
+ "undefined"
7130
+ ],
7131
+ "required": true
7132
+ },
7133
+ "source": {
7134
+ "module": "./src/sds-textfield/sds-textfield.ts",
7135
+ "symbol": "SDSTextField.max"
7136
+ }
7137
+ },
7080
7138
  {
7081
7139
  "name": "size",
7082
7140
  "required": false,
@@ -7333,6 +7391,40 @@
7333
7391
  "symbol": "SDSTextField.maxlength"
7334
7392
  }
7335
7393
  },
7394
+ {
7395
+ "name": "min",
7396
+ "required": false,
7397
+ "priority": "normal",
7398
+ "value": {
7399
+ "type": [
7400
+ "string",
7401
+ "number",
7402
+ "undefined"
7403
+ ],
7404
+ "required": true
7405
+ },
7406
+ "source": {
7407
+ "module": "./src/sds-textfield/sds-textfield.ts",
7408
+ "symbol": "SDSTextField.min"
7409
+ }
7410
+ },
7411
+ {
7412
+ "name": "max",
7413
+ "required": false,
7414
+ "priority": "normal",
7415
+ "value": {
7416
+ "type": [
7417
+ "string",
7418
+ "number",
7419
+ "undefined"
7420
+ ],
7421
+ "required": true
7422
+ },
7423
+ "source": {
7424
+ "module": "./src/sds-textfield/sds-textfield.ts",
7425
+ "symbol": "SDSTextField.max"
7426
+ }
7427
+ },
7336
7428
  {
7337
7429
  "name": "size",
7338
7430
  "required": false,
@@ -7471,7 +7563,7 @@
7471
7563
  "value": {
7472
7564
  "type": "(event: KeyboardEvent) => void",
7473
7565
  "required": true,
7474
- "default": "\"(event: KeyboardEvent) => {\\n\\t\\tevent.stopImmediatePropagation();\\n\\n\\t\\tconst shouldContinue = this.dispatchKeyboardEvent('keydown', event);\\n\\n\\t\\tif (!shouldContinue) return;\\n\\n\\t\\tif (event.key === 'Enter') {\\n\\t\\t\\tconst form = this.form;\\n\\n\\t\\t\\tif (form?.requestSubmit) {\\n\\t\\t\\t\\t// Try to use requestSubmit as this will run form validation before submitting\\n\\t\\t\\t\\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit#usage_notes\\n\\t\\t\\t\\tform.requestSubmit();\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tform?.submit();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\""
7566
+ "default": "\"(event: KeyboardEvent) => {\\n\\t\\tevent.stopImmediatePropagation();\\n\\n\\t\\tconst shouldContinue = this.dispatchKeyboardEvent('keydown', event);\\n\\t\\tif (!shouldContinue) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tif (event.key !== 'Enter') {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tfor (const element of Array.from(this.form?.elements ?? [])) {\\n\\t\\t\\tif (element instanceof HTMLButtonElement || element instanceof HTMLInputElement) {\\n\\t\\t\\t\\tif (element.type !== 'submit') {\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif (element.disabled) {\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\telement.click();\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tthis.form?.requestSubmit();\\n\\t}\""
7475
7567
  },
7476
7568
  "source": {
7477
7569
  "module": "./src/sds-textfield/sds-textfield.ts",
@@ -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"],"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G,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,uBAAuB;IACvB,0BAA0B;IAC1B,mCAAmC;IACnC,oCAAoC;IACpC,mCAAmC;IACnC,sCAAsC;IACtC,kCAAkC;IAClC,mCAAmC;IACnC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,kCAAkC;IAClC,i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,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,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,MAA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AM,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":""}