@tft/crispr-forms-testing 21.0.14 → 21.0.15

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 (38) hide show
  1. package/field-tests/autocomplete-chiplist.tests.d.ts +1 -1
  2. package/field-tests/autocomplete-chiplist.tests.js +25 -22
  3. package/field-tests/autocomplete-chiplist.tests.js.map +1 -1
  4. package/field-tests/autocomplete.tests.d.ts +1 -1
  5. package/field-tests/autocomplete.tests.js +22 -19
  6. package/field-tests/autocomplete.tests.js.map +1 -1
  7. package/field-tests/checkbox.tests.d.ts +1 -1
  8. package/field-tests/checkbox.tests.js +18 -15
  9. package/field-tests/checkbox.tests.js.map +1 -1
  10. package/field-tests/datepicker.tests.d.ts +1 -1
  11. package/field-tests/datepicker.tests.js +18 -15
  12. package/field-tests/datepicker.tests.js.map +1 -1
  13. package/field-tests/field-test-factory.d.ts +1 -1
  14. package/field-tests/field-test-factory.js +28 -24
  15. package/field-tests/field-test-factory.js.map +1 -1
  16. package/field-tests/file-upload.tests.d.ts +1 -1
  17. package/field-tests/file-upload.tests.js +15 -12
  18. package/field-tests/file-upload.tests.js.map +1 -1
  19. package/field-tests/input.tests.d.ts +1 -1
  20. package/field-tests/input.tests.js +39 -36
  21. package/field-tests/input.tests.js.map +1 -1
  22. package/field-tests/select.tests.d.ts +1 -1
  23. package/field-tests/select.tests.js +21 -18
  24. package/field-tests/select.tests.js.map +1 -1
  25. package/field-tests/slider.tests.d.ts +1 -1
  26. package/field-tests/slider.tests.js +13 -10
  27. package/field-tests/slider.tests.js.map +1 -1
  28. package/field-tests/textarea.tests.d.ts +1 -1
  29. package/field-tests/textarea.tests.js +15 -12
  30. package/field-tests/textarea.tests.js.map +1 -1
  31. package/field-tests/unit-conversion.tests.d.ts +1 -1
  32. package/field-tests/unit-conversion.tests.js +13 -10
  33. package/field-tests/unit-conversion.tests.js.map +1 -1
  34. package/helpers/form.helpers.js +34 -16
  35. package/helpers/form.helpers.js.map +1 -1
  36. package/index.js +30 -14
  37. package/index.js.map +1 -1
  38. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { AutocompleteChiplistFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { AutocompleteChiplistFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for an AUTOCOMPLETE_CHIPLIST field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -1,5 +1,8 @@
1
- import { test, expect } from '@playwright/test';
2
- import { getLabel, getHint, getError, getMatFormField, submitForm } from '../helpers/form.helpers';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testAutocompleteChiplistField = testAutocompleteChiplistField;
4
+ const test_1 = require("@playwright/test");
5
+ const form_helpers_1 = require("../helpers/form.helpers");
3
6
  /**
4
7
  * Registers Playwright tests for an AUTOCOMPLETE_CHIPLIST field config.
5
8
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -8,44 +11,44 @@ import { getLabel, getHint, getError, getMatFormField, submitForm } from '../hel
8
11
  * the hidden `[formControlName]` anchor is what holds validators. Blurring the
9
12
  * visible search input does not touch the hidden control.
10
13
  */
11
- export function testAutocompleteChiplistField(config) {
14
+ function testAutocompleteChiplistField(config) {
12
15
  if (config.label) {
13
- test('renders label', async ({ page }) => {
14
- await expect(getLabel(page, config.controlName)).toHaveText(config.label);
16
+ (0, test_1.test)('renders label', async ({ page }) => {
17
+ await (0, test_1.expect)((0, form_helpers_1.getLabel)(page, config.controlName)).toHaveText(config.label);
15
18
  });
16
19
  }
17
20
  if (config.hint) {
18
- test('shows hint when untouched', async ({ page }) => {
19
- await expect(getHint(page, config.controlName)).toBeVisible();
21
+ (0, test_1.test)('shows hint when untouched', async ({ page }) => {
22
+ await (0, test_1.expect)((0, form_helpers_1.getHint)(page, config.controlName)).toBeVisible();
20
23
  });
21
24
  }
22
- test('can type and see options', async ({ page }) => {
23
- const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');
25
+ (0, test_1.test)('can type and see options', async ({ page }) => {
26
+ const searchInput = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('input[matInput]');
24
27
  await searchInput.fill('Option');
25
28
  const options = page.locator('mat-option');
26
- await expect(options.first()).toBeVisible();
29
+ await (0, test_1.expect)(options.first()).toBeVisible();
27
30
  });
28
- test('can add a chip by selecting an option', async ({ page }) => {
29
- const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');
31
+ (0, test_1.test)('can add a chip by selecting an option', async ({ page }) => {
32
+ const searchInput = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('input[matInput]');
30
33
  await searchInput.fill('Option A');
31
34
  await page.locator('mat-option').filter({ hasText: 'Option A' }).click();
32
- const chip = getMatFormField(page, config.controlName).locator('mat-chip-row').first();
33
- await expect(chip).toContainText('Option A');
35
+ const chip = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('mat-chip-row').first();
36
+ await (0, test_1.expect)(chip).toContainText('Option A');
34
37
  });
35
- test('can remove a chip', async ({ page }) => {
36
- const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');
38
+ (0, test_1.test)('can remove a chip', async ({ page }) => {
39
+ const searchInput = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('input[matInput]');
37
40
  await searchInput.fill('Option A');
38
41
  await page.locator('mat-option').filter({ hasText: 'Option A' }).click();
39
- const removeBtn = getMatFormField(page, config.controlName).locator('mat-chip-row mat-icon[matChipRemove]').first();
42
+ const removeBtn = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('mat-chip-row mat-icon[matChipRemove]').first();
40
43
  if (await removeBtn.isVisible()) {
41
44
  await removeBtn.click();
42
- const chips = getMatFormField(page, config.controlName).locator('mat-chip-row');
43
- await expect(chips).toHaveCount(0);
45
+ const chips = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('mat-chip-row');
46
+ await (0, test_1.expect)(chips).toHaveCount(0);
44
47
  }
45
48
  });
46
- test('shows error when not enough chips selected', async ({ page }) => {
47
- await submitForm(page);
48
- await expect(getError(page, config.controlName, 'autocomplete-chiplist')).toBeVisible();
49
+ (0, test_1.test)('shows error when not enough chips selected', async ({ page }) => {
50
+ await (0, form_helpers_1.submitForm)(page);
51
+ await (0, test_1.expect)((0, form_helpers_1.getError)(page, config.controlName, 'autocomplete-chiplist')).toBeVisible();
49
52
  });
50
53
  }
51
54
  //# sourceMappingURL=autocomplete-chiplist.tests.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-chiplist.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/autocomplete-chiplist.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEnG;;;;;;;GAOG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAuC;IACnF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,2BAA2B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACnD,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,0BAA0B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QA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EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QACzE,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC,KAAK,EAAE,CAAC;QACpH,IAAI,MAAM,SAAS,CAAC,SAAS,EAAE,EAAE,CAAC;YAChC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAChF,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4CAA4C,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACpE,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;QACvB,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { AutocompleteChiplistFieldConfig } from '@tft/crispr-forms/utils';\nimport { getLabel, getHint, getError, getMatFormField, submitForm } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for an AUTOCOMPLETE_CHIPLIST field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n *\n * Note: like autocomplete, errors require `submitForm()` rather than blur because\n * the hidden `[formControlName]` anchor is what holds validators. Blurring the\n * visible search input does not touch the hidden control.\n */\nexport function testAutocompleteChiplistField(config: AutocompleteChiplistFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('can type and see options', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option');\n const options = page.locator('mat-option');\n await expect(options.first()).toBeVisible();\n });\n\n test('can add a chip by selecting an option', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n const chip = getMatFormField(page, config.controlName).locator('mat-chip-row').first();\n await expect(chip).toContainText('Option A');\n });\n\n test('can remove a chip', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n const removeBtn = getMatFormField(page, config.controlName).locator('mat-chip-row mat-icon[matChipRemove]').first();\n if (await removeBtn.isVisible()) {\n await removeBtn.click();\n const chips = getMatFormField(page, config.controlName).locator('mat-chip-row');\n await expect(chips).toHaveCount(0);\n }\n });\n\n test('shows error when not enough chips selected', async ({ page }) => {\n await submitForm(page);\n await expect(getError(page, config.controlName, 'autocomplete-chiplist')).toBeVisible();\n });\n}\n"]}
1
+ {"version":3,"file":"autocomplete-chiplist.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/autocomplete-chiplist.tests.ts"],"names":[],"mappings":";;AAYA,sEA4CC;AAxDD,2CAAgD;AAEhD,0DAAmG;AAEnG;;;;;;;GAOG;AACH,SAAgB,6BAA6B,CAAC,MAAuC;IACnF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAA,WAAI,EAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,IAAA,aAAM,EAAC,IAAA,uBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QA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AC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { AutocompleteChiplistFieldConfig } from '@tft/crispr-forms';\nimport { getLabel, getHint, getError, getMatFormField, submitForm } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for an AUTOCOMPLETE_CHIPLIST field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n *\n * Note: like autocomplete, errors require `submitForm()` rather than blur because\n * the hidden `[formControlName]` anchor is what holds validators. Blurring the\n * visible search input does not touch the hidden control.\n */\nexport function testAutocompleteChiplistField(config: AutocompleteChiplistFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('can type and see options', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option');\n const options = page.locator('mat-option');\n await expect(options.first()).toBeVisible();\n });\n\n test('can add a chip by selecting an option', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n const chip = getMatFormField(page, config.controlName).locator('mat-chip-row').first();\n await expect(chip).toContainText('Option A');\n });\n\n test('can remove a chip', async ({ page }) => {\n const searchInput = getMatFormField(page, config.controlName).locator('input[matInput]');\n await searchInput.fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n const removeBtn = getMatFormField(page, config.controlName).locator('mat-chip-row mat-icon[matChipRemove]').first();\n if (await removeBtn.isVisible()) {\n await removeBtn.click();\n const chips = getMatFormField(page, config.controlName).locator('mat-chip-row');\n await expect(chips).toHaveCount(0);\n }\n });\n\n test('shows error when not enough chips selected', async ({ page }) => {\n await submitForm(page);\n await expect(getError(page, config.controlName, 'autocomplete-chiplist')).toBeVisible();\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { AutocompleteFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { AutocompleteFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for an AUTOCOMPLETE field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -1,6 +1,9 @@
1
- import { test, expect } from '@playwright/test';
2
- import { Validators } from '@angular/forms';
3
- import { getLabel, getHint, getError, getAutocompleteInput, submitForm } from '../helpers/form.helpers';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testAutocompleteField = testAutocompleteField;
4
+ const test_1 = require("@playwright/test");
5
+ const forms_1 = require("@angular/forms");
6
+ const form_helpers_1 = require("../helpers/form.helpers");
4
7
  /**
5
8
  * Registers Playwright tests for an AUTOCOMPLETE field config.
6
9
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -10,32 +13,32 @@ import { getLabel, getHint, getError, getAutocompleteInput, submitForm } from '.
10
13
  * the visible input does not touch the hidden control. `submitForm()` fires
11
14
  * `ControlErrorsFormDirective.submit$` which forces all controls to show errors.
12
15
  */
13
- export function testAutocompleteField(config) {
16
+ function testAutocompleteField(config) {
14
17
  if (config.label) {
15
- test('renders label', async ({ page }) => {
16
- await expect(getLabel(page, config.controlName)).toHaveText(config.label);
18
+ (0, test_1.test)('renders label', async ({ page }) => {
19
+ await (0, test_1.expect)((0, form_helpers_1.getLabel)(page, config.controlName)).toHaveText(config.label);
17
20
  });
18
21
  }
19
22
  if (config.hint) {
20
- test('shows hint when untouched', async ({ page }) => {
21
- await expect(getHint(page, config.controlName)).toBeVisible();
23
+ (0, test_1.test)('shows hint when untouched', async ({ page }) => {
24
+ await (0, test_1.expect)((0, form_helpers_1.getHint)(page, config.controlName)).toBeVisible();
22
25
  });
23
26
  }
24
- test('shows dropdown options when typing', async ({ page }) => {
25
- await getAutocompleteInput(page, config.controlName).fill('Option');
27
+ (0, test_1.test)('shows dropdown options when typing', async ({ page }) => {
28
+ await (0, form_helpers_1.getAutocompleteInput)(page, config.controlName).fill('Option');
26
29
  const options = page.locator('mat-option');
27
- await expect(options.first()).toBeVisible();
30
+ await (0, test_1.expect)(options.first()).toBeVisible();
28
31
  });
29
- test('can select an autocomplete option', async ({ page }) => {
30
- await getAutocompleteInput(page, config.controlName).fill('Option A');
32
+ (0, test_1.test)('can select an autocomplete option', async ({ page }) => {
33
+ await (0, form_helpers_1.getAutocompleteInput)(page, config.controlName).fill('Option A');
31
34
  await page.locator('mat-option').filter({ hasText: 'Option A' }).click();
32
- await expect(getAutocompleteInput(page, config.controlName)).toHaveValue('Option A');
35
+ await (0, test_1.expect)((0, form_helpers_1.getAutocompleteInput)(page, config.controlName)).toHaveValue('Option A');
33
36
  });
34
- if (config.validators?.includes(Validators.required)) {
35
- test('shows required error when form submitted empty', async ({ page }) => {
36
- await getAutocompleteInput(page, config.controlName).fill('');
37
- await submitForm(page);
38
- await expect(getError(page, config.controlName, 'autocomplete')).toBeVisible();
37
+ if (config.validators?.includes(forms_1.Validators.required)) {
38
+ (0, test_1.test)('shows required error when form submitted empty', async ({ page }) => {
39
+ await (0, form_helpers_1.getAutocompleteInput)(page, config.controlName).fill('');
40
+ await (0, form_helpers_1.submitForm)(page);
41
+ await (0, test_1.expect)((0, form_helpers_1.getError)(page, config.controlName, 'autocomplete')).toBeVisible();
39
42
  });
40
43
  }
41
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/autocomplete.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAExG;;;;;;;;GAQG;AACH,MAA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BAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,IAAI,CAAC,gDAAgD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACxE,MAAM,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9D,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;YACvB,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { AutocompleteFieldConfig } from '@tft/crispr-forms/utils';\nimport { Validators } from '@angular/forms';\nimport { getLabel, getHint, getError, getAutocompleteInput, submitForm } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for an AUTOCOMPLETE field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n *\n * Note: errors are triggered via `submitForm()` rather than blur because the\n * autocomplete uses a hidden `[formControlName]` anchor for validation — blurring\n * the visible input does not touch the hidden control. `submitForm()` fires\n * `ControlErrorsFormDirective.submit$` which forces all controls to show errors.\n */\nexport function testAutocompleteField(config: AutocompleteFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('shows dropdown options when typing', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('Option');\n const options = page.locator('mat-option');\n await expect(options.first()).toBeVisible();\n });\n\n test('can select an autocomplete option', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n await expect(getAutocompleteInput(page, config.controlName)).toHaveValue('Option A');\n });\n\n if (config.validators?.includes(Validators.required)) {\n test('shows required error when form submitted empty', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('');\n await submitForm(page);\n await expect(getError(page, config.controlName, 'autocomplete')).toBeVisible();\n });\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/autocomplete.tests.ts"],"names":[],"mappings":";;AAcA,sDAgCC;AA9CD,2CAAgD;AAEhD,0CAA4C;AAC5C,0DAAwG;AAExG;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,MAA+B;IACnE,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAA,WAAI,EAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,IAAA,aAAM,EAAC,IAAA,uBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAA,WAAI,EAAC,2BAA2B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACnD,MAAM,IAAA,aAAM,EAAC,IAAA,sBAAO,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAA,WAAI,EAAC,oCAAoC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5D,MAAM,IAAA,mCAAoB,EAAC,IAAI,EAAE,M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import type { AutocompleteFieldConfig } from '@tft/crispr-forms';\nimport { Validators } from '@angular/forms';\nimport { getLabel, getHint, getError, getAutocompleteInput, submitForm } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for an AUTOCOMPLETE field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n *\n * Note: errors are triggered via `submitForm()` rather than blur because the\n * autocomplete uses a hidden `[formControlName]` anchor for validation — blurring\n * the visible input does not touch the hidden control. `submitForm()` fires\n * `ControlErrorsFormDirective.submit$` which forces all controls to show errors.\n */\nexport function testAutocompleteField(config: AutocompleteFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('shows dropdown options when typing', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('Option');\n const options = page.locator('mat-option');\n await expect(options.first()).toBeVisible();\n });\n\n test('can select an autocomplete option', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('Option A');\n await page.locator('mat-option').filter({ hasText: 'Option A' }).click();\n await expect(getAutocompleteInput(page, config.controlName)).toHaveValue('Option A');\n });\n\n if (config.validators?.includes(Validators.required)) {\n test('shows required error when form submitted empty', async ({ page }) => {\n await getAutocompleteInput(page, config.controlName).fill('');\n await submitForm(page);\n await expect(getError(page, config.controlName, 'autocomplete')).toBeVisible();\n });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { CheckboxFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { CheckboxFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for a CHECKBOX field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -1,26 +1,29 @@
1
- import { test, expect } from '@playwright/test';
2
- import { Validators } from '@angular/forms';
3
- import { getCheckbox, getError } from '../helpers/form.helpers';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testCheckboxField = testCheckboxField;
4
+ const test_1 = require("@playwright/test");
5
+ const forms_1 = require("@angular/forms");
6
+ const form_helpers_1 = require("../helpers/form.helpers");
4
7
  /**
5
8
  * Registers Playwright tests for a CHECKBOX field config.
6
9
  * Call inside a `test.describe` block that has already navigated to the page.
7
10
  */
8
- export function testCheckboxField(config) {
9
- test('renders label', async ({ page }) => {
10
- const label = getCheckbox(page, config.controlName).locator('.mdc-label');
11
- await expect(label).toContainText(config.label);
11
+ function testCheckboxField(config) {
12
+ (0, test_1.test)('renders label', async ({ page }) => {
13
+ const label = (0, form_helpers_1.getCheckbox)(page, config.controlName).locator('.mdc-label');
14
+ await (0, test_1.expect)(label).toContainText(config.label);
12
15
  });
13
- if (config.validators?.includes(Validators.requiredTrue)) {
14
- test('shows error when unchecked and blurred', async ({ page }) => {
15
- await getCheckbox(page, config.controlName).click();
16
- await getCheckbox(page, config.controlName).click();
16
+ if (config.validators?.includes(forms_1.Validators.requiredTrue)) {
17
+ (0, test_1.test)('shows error when unchecked and blurred', async ({ page }) => {
18
+ await (0, form_helpers_1.getCheckbox)(page, config.controlName).click();
19
+ await (0, form_helpers_1.getCheckbox)(page, config.controlName).click();
17
20
  await page.keyboard.press('Tab');
18
- await expect(getError(page, config.controlName, 'checkbox')).toBeVisible();
21
+ await (0, test_1.expect)((0, form_helpers_1.getError)(page, config.controlName, 'checkbox')).toBeVisible();
19
22
  });
20
- test('no error when checked', async ({ page }) => {
21
- await getCheckbox(page, config.controlName).click();
23
+ (0, test_1.test)('no error when checked', async ({ page }) => {
24
+ await (0, form_helpers_1.getCheckbox)(page, config.controlName).click();
22
25
  await page.keyboard.press('Tab');
23
- await expect(getError(page, config.controlName, 'checkbox')).not.toBeVisible();
26
+ await (0, test_1.expect)((0, form_helpers_1.getError)(page, config.controlName, 'checkbox')).not.toBeVisible();
24
27
  });
25
28
  }
26
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"check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AAW,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;YACpD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACjC,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { CheckboxFieldConfig } from '@tft/crispr-forms/utils';\nimport { Validators } from '@angular/forms';\nimport { getCheckbox, getError } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a CHECKBOX field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testCheckboxField(config: CheckboxFieldConfig) {\n test('renders label', async ({ page }) => {\n const label = getCheckbox(page, config.controlName).locator('.mdc-label');\n await expect(label).toContainText(config.label);\n });\n\n if (config.validators?.includes(Validators.requiredTrue)) {\n test('shows error when unchecked and blurred', async ({ page }) => {\n await getCheckbox(page, config.controlName).click();\n await getCheckbox(page, config.controlName).click();\n await page.keyboard.press('Tab');\n await expect(getError(page, config.controlName, 'checkbox')).toBeVisible();\n });\n\n test('no error when checked', async ({ page }) => {\n await getCheckbox(page, config.controlName).click();\n await page.keyboard.press('Tab');\n await expect(getError(page, config.controlName, 'checkbox')).not.toBeVisible();\n });\n }\n}\n"]}
1
+ {"version":3,"file":"checkbox.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/checkbox.tests.ts"],"names":[],"mappings":";;AASA,8CAoBC;AA7BD,2CAAgD;AAEhD,0CAA4C;AAC5C,0DAAgE;AAEhE;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,MAA2B;IAC3D,IAAA,WAAI,EAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACvC,MAAM,KAAK,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@playwright/test';\nimport type { CheckboxFieldConfig } from '@tft/crispr-forms';\nimport { Validators } from '@angular/forms';\nimport { getCheckbox, getError } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a CHECKBOX field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testCheckboxField(config: CheckboxFieldConfig) {\n test('renders label', async ({ page }) => {\n const label = getCheckbox(page, config.controlName).locator('.mdc-label');\n await expect(label).toContainText(config.label);\n });\n\n if (config.validators?.includes(Validators.requiredTrue)) {\n test('shows error when unchecked and blurred', async ({ page }) => {\n await getCheckbox(page, config.controlName).click();\n await getCheckbox(page, config.controlName).click();\n await page.keyboard.press('Tab');\n await expect(getError(page, config.controlName, 'checkbox')).toBeVisible();\n });\n\n test('no error when checked', async ({ page }) => {\n await getCheckbox(page, config.controlName).click();\n await page.keyboard.press('Tab');\n await expect(getError(page, config.controlName, 'checkbox')).not.toBeVisible();\n });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { DatepickerFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { DatepickerFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for a DATEPICKER field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -1,29 +1,32 @@
1
- import { test, expect } from '@playwright/test';
2
- import { Validators } from '@angular/forms';
3
- import { getLabel, getHint, getError, getMatFormField, touchDatepicker } from '../helpers/form.helpers';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testDatepickerField = testDatepickerField;
4
+ const test_1 = require("@playwright/test");
5
+ const forms_1 = require("@angular/forms");
6
+ const form_helpers_1 = require("../helpers/form.helpers");
4
7
  /**
5
8
  * Registers Playwright tests for a DATEPICKER field config.
6
9
  * Call inside a `test.describe` block that has already navigated to the page.
7
10
  */
8
- export function testDatepickerField(config) {
11
+ function testDatepickerField(config) {
9
12
  if (config.label) {
10
- test('renders label', async ({ page }) => {
11
- await expect(getLabel(page, config.controlName)).toHaveText(config.label);
13
+ (0, test_1.test)('renders label', async ({ page }) => {
14
+ await (0, test_1.expect)((0, form_helpers_1.getLabel)(page, config.controlName)).toHaveText(config.label);
12
15
  });
13
16
  }
14
17
  if (config.hint) {
15
- test('shows hint when untouched', async ({ page }) => {
16
- await expect(getHint(page, config.controlName)).toBeVisible();
18
+ (0, test_1.test)('shows hint when untouched', async ({ page }) => {
19
+ await (0, test_1.expect)((0, form_helpers_1.getHint)(page, config.controlName)).toBeVisible();
17
20
  });
18
21
  }
19
- test('renders datepicker toggle button', async ({ page }) => {
20
- const toggle = getMatFormField(page, config.controlName).locator('mat-datepicker-toggle');
21
- await expect(toggle).toBeVisible();
22
+ (0, test_1.test)('renders datepicker toggle button', async ({ page }) => {
23
+ const toggle = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('mat-datepicker-toggle');
24
+ await (0, test_1.expect)(toggle).toBeVisible();
22
25
  });
23
- if (config.validators?.includes(Validators.required)) {
24
- test('shows required error when blurred without date', async ({ page }) => {
25
- await touchDatepicker(page, config.controlName);
26
- await expect(getError(page, config.controlName, 'datepicker')).toBeVisible();
26
+ if (config.validators?.includes(forms_1.Validators.required)) {
27
+ (0, test_1.test)('shows required error when blurred without date', async ({ page }) => {
28
+ await (0, form_helpers_1.touchDatepicker)(page, config.controlName);
29
+ await (0, test_1.expect)((0, form_helpers_1.getError)(page, config.controlName, 'datepicker')).toBeVisible();
27
30
  });
28
31
  }
29
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/datepicker.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,C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,CAAC;AACH,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { DatepickerFieldConfig } from '@tft/crispr-forms/utils';\nimport { Validators } from '@angular/forms';\nimport { getLabel, getHint, getError, getMatFormField, touchDatepicker } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a DATEPICKER field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testDatepickerField(config: DatepickerFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('renders datepicker toggle button', async ({ page }) => {\n const toggle = getMatFormField(page, config.controlName).locator('mat-datepicker-toggle');\n await expect(toggle).toBeVisible();\n });\n\n if (config.validators?.includes(Validators.required)) {\n test('shows required error when blurred without date', async ({ page }) => {\n await touchDatepicker(page, config.controlName);\n await expect(getError(page, config.controlName, 'datepicker')).toBeVisible();\n });\n }\n}\n"]}
1
+ {"version":3,"file":"datepicker.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/datepicker.tests.ts"],"names":[],"mappings":";;AASA,kDAwBC;AAjCD,2CAAgD;AAEhD,0CAA4C;AAC5C,0DAAwG;AAExG;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,MAA6B;IAC/D,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAA,WAAI,EAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,IAAA,aAAM,EAAC,IAAA,uBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAA,WAAI,EAAC,2BAA2B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACnD,MAAM,IAAA,aAAM,EAAC,IAAA,sBAAO,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAChE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAA,WAAI,EAAC,kCAAkC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC1D,MAAM,MAAM,GAAG,IAAA,8BAAe,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;QAC1F,MAAM,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,kBAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,IAAA,WAAI,EAAC,gDAAgD,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACxE,MAAM,IAAA,8BAAe,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;YAChD,MAAM,IAAA,aAAM,EAAC,IAAA,uBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { DatepickerFieldConfig } from '@tft/crispr-forms';\nimport { Validators } from '@angular/forms';\nimport { getLabel, getHint, getError, getMatFormField, touchDatepicker } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a DATEPICKER field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testDatepickerField(config: DatepickerFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n if (config.hint) {\n test('shows hint when untouched', async ({ page }) => {\n await expect(getHint(page, config.controlName)).toBeVisible();\n });\n }\n\n test('renders datepicker toggle button', async ({ page }) => {\n const toggle = getMatFormField(page, config.controlName).locator('mat-datepicker-toggle');\n await expect(toggle).toBeVisible();\n });\n\n if (config.validators?.includes(Validators.required)) {\n test('shows required error when blurred without date', async ({ page }) => {\n await touchDatepicker(page, config.controlName);\n await expect(getError(page, config.controlName, 'datepicker')).toBeVisible();\n });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { FormConfig, AnyFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { FormConfig, AnyFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers a `test.describe` block for a field config, automatically selecting
4
4
  * the correct test suite based on `controlType`.
@@ -1,14 +1,18 @@
1
- import { test } from '@playwright/test';
2
- import { testInputField } from './input.tests';
3
- import { testTextareaField } from './textarea.tests';
4
- import { testCheckboxField } from './checkbox.tests';
5
- import { testSelectField } from './select.tests';
6
- import { testSliderField } from './slider.tests';
7
- import { testDatepickerField } from './datepicker.tests';
8
- import { testAutocompleteField } from './autocomplete.tests';
9
- import { testAutocompleteChiplistField } from './autocomplete-chiplist.tests';
10
- import { testFileUploadField } from './file-upload.tests';
11
- import { testUnitConversionField } from './unit-conversion.tests';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testField = testField;
4
+ exports.testForm = testForm;
5
+ const test_1 = require("@playwright/test");
6
+ const input_tests_1 = require("./input.tests");
7
+ const textarea_tests_1 = require("./textarea.tests");
8
+ const checkbox_tests_1 = require("./checkbox.tests");
9
+ const select_tests_1 = require("./select.tests");
10
+ const slider_tests_1 = require("./slider.tests");
11
+ const datepicker_tests_1 = require("./datepicker.tests");
12
+ const autocomplete_tests_1 = require("./autocomplete.tests");
13
+ const autocomplete_chiplist_tests_1 = require("./autocomplete-chiplist.tests");
14
+ const file_upload_tests_1 = require("./file-upload.tests");
15
+ const unit_conversion_tests_1 = require("./unit-conversion.tests");
12
16
  /**
13
17
  * Registers a `test.describe` block for a field config, automatically selecting
14
18
  * the correct test suite based on `controlType`.
@@ -28,40 +32,40 @@ import { testUnitConversionField } from './unit-conversion.tests';
28
32
  * });
29
33
  * ```
30
34
  */
31
- export function testField(config) {
35
+ function testField(config) {
32
36
  if (!('controlName' in config))
33
37
  return;
34
- test.describe(config.controlName, () => {
38
+ test_1.test.describe(config.controlName, () => {
35
39
  switch (config.controlType) {
36
40
  case 'input':
37
- testInputField(config);
41
+ (0, input_tests_1.testInputField)(config);
38
42
  break;
39
43
  case 'textarea':
40
- testTextareaField(config);
44
+ (0, textarea_tests_1.testTextareaField)(config);
41
45
  break;
42
46
  case 'checkbox':
43
- testCheckboxField(config);
47
+ (0, checkbox_tests_1.testCheckboxField)(config);
44
48
  break;
45
49
  case 'select':
46
- testSelectField(config);
50
+ (0, select_tests_1.testSelectField)(config);
47
51
  break;
48
52
  case 'slider':
49
- testSliderField(config);
53
+ (0, slider_tests_1.testSliderField)(config);
50
54
  break;
51
55
  case 'datepicker':
52
- testDatepickerField(config);
56
+ (0, datepicker_tests_1.testDatepickerField)(config);
53
57
  break;
54
58
  case 'autocomplete':
55
- testAutocompleteField(config);
59
+ (0, autocomplete_tests_1.testAutocompleteField)(config);
56
60
  break;
57
61
  case 'autocompleteChiplist':
58
- testAutocompleteChiplistField(config);
62
+ (0, autocomplete_chiplist_tests_1.testAutocompleteChiplistField)(config);
59
63
  break;
60
64
  case 'fileUpload':
61
- testFileUploadField(config);
65
+ (0, file_upload_tests_1.testFileUploadField)(config);
62
66
  break;
63
67
  case 'unitConversion':
64
- testUnitConversionField(config);
68
+ (0, unit_conversion_tests_1.testUnitConversionField)(config);
65
69
  break;
66
70
  }
67
71
  });
@@ -78,7 +82,7 @@ export function testField(config) {
78
82
  * });
79
83
  * ```
80
84
  */
81
- export function testForm(config) {
85
+ function testForm(config) {
82
86
  for (const field of config.fields) {
83
87
  testField(field);
84
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"field-test-factory.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/field-test-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAexC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,SAAS,CAAC,MAAsB;IAC9C,IAAI,CAAC,CAAC,aAAa,IAAI,MAAM,CAAC;QAAE,OAAO;IAEvC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE;QACrC,QAAQ,MAAM,CAAC,WAAW,EAAE,CAAC;YAC3B,KAAK,OAAO;gBACV,cAAc,CAAC,MAA0B,CAAC,CAAC;gBAC3C,MAAM;YACR,KAAK,UAAU;gBACb,iBAAiB,CAAC,MAA6B,CAAC,CAAC;gBACjD,MAAM;YACR,KAAK,UAAU;gBACb,iBAAiB,CAAC,MAA6B,CAAC,CAAC;gBACjD,MAAM;YACR,KAAK,QAAQ;gBACX,eAAe,CAAC,MAA2B,CAAC,CAAC;gBAC7C,MAAM;YACR,KAAK,QAAQ;gBACX,eAAe,CAAC,MAA2B,CAAC,CAAC;gBAC7C,MAAM;YACR,KAAK,YAAY;gBACf,mBAAmB,CAAC,MAA+B,CAAC,CAAC;gBACrD,MAAM;YACR,KAAK,cAAc;gBACjB,qBAAqB,CAAC,MAAiC,CAAC,CAAC;gBACzD,MAAM;YACR,KAAK,sBAAsB;gBACzB,6BAA6B,CAAC,MAAyC,CAAC,CAAC;gBACzE,MAAM;YACR,KAAK,YAAY;gBACf,mBAAmB,CAAC,MAA+B,CAAC,CAAC;gBACrD,MAAM;YACR,KAAK,gBAAgB;gBACnB,uBAAuB,CAAC,MAAmC,CAAC,CAAC;gBAC7D,MAAM;QACV,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAkB;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { test } from '@playwright/test';\nimport type {\n FormConfig,\n AnyFieldConfig,\n InputFieldConfig,\n TextareaFieldConfig,\n CheckboxFieldConfig,\n SelectFieldConfig,\n SliderFieldConfig,\n DatepickerFieldConfig,\n AutocompleteFieldConfig,\n AutocompleteChiplistFieldConfig,\n FileUploadFieldConfig,\n UnitConversionFieldConfig,\n} from '@tft/crispr-forms/utils';\nimport { testInputField } from './input.tests';\nimport { testTextareaField } from './textarea.tests';\nimport { testCheckboxField } from './checkbox.tests';\nimport { testSelectField } from './select.tests';\nimport { testSliderField } from './slider.tests';\nimport { testDatepickerField } from './datepicker.tests';\nimport { testAutocompleteField } from './autocomplete.tests';\nimport { testAutocompleteChiplistField } from './autocomplete-chiplist.tests';\nimport { testFileUploadField } from './file-upload.tests';\nimport { testUnitConversionField } from './unit-conversion.tests';\n\n/**\n * Registers a `test.describe` block for a field config, automatically selecting\n * the correct test suite based on `controlType`.\n *\n * Non-control fields (heading, divider, button) are skipped silently.\n *\n * @example\n * ```ts\n * import { testField } from '@tft/crispr-forms-testing';\n * import { myFormConfig } from './my-form.config';\n *\n * test.describe('My Form', () => {\n * test.beforeEach(async ({ page }) => page.goto('/my-form'));\n * for (const field of myFormConfig.fields) {\n * testField(field);\n * }\n * });\n * ```\n */\nexport function testField(config: AnyFieldConfig) {\n if (!('controlName' in config)) return;\n\n test.describe(config.controlName, () => {\n switch (config.controlType) {\n case 'input':\n testInputField(config as InputFieldConfig);\n break;\n case 'textarea':\n testTextareaField(config as TextareaFieldConfig);\n break;\n case 'checkbox':\n testCheckboxField(config as CheckboxFieldConfig);\n break;\n case 'select':\n testSelectField(config as SelectFieldConfig);\n break;\n case 'slider':\n testSliderField(config as SliderFieldConfig);\n break;\n case 'datepicker':\n testDatepickerField(config as DatepickerFieldConfig);\n break;\n case 'autocomplete':\n testAutocompleteField(config as AutocompleteFieldConfig);\n break;\n case 'autocompleteChiplist':\n testAutocompleteChiplistField(config as AutocompleteChiplistFieldConfig);\n break;\n case 'fileUpload':\n testFileUploadField(config as FileUploadFieldConfig);\n break;\n case 'unitConversion':\n testUnitConversionField(config as UnitConversionFieldConfig);\n break;\n }\n });\n}\n\n/**\n * Registers a `testField` block for every field in a `FormConfig`.\n * Non-control fields (heading, divider, button) are skipped automatically.\n *\n * @example\n * ```ts\n * test.describe('My Form', () => {\n * test.beforeEach(async ({ page }) => page.goto('/my-form'));\n * testForm(myFormConfig);\n * });\n * ```\n */\nexport function testForm(config: FormConfig) {\n for (const field of config.fields) {\n testField(field);\n }\n}\n"]}
1
+ {"version":3,"file":"field-test-factory.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/field-test-factory.ts"],"names":[],"mappings":";;AA6CA,8BAqCC;AAcD,4BAIC;AApGD,2CAAwC;AAexC,+CAA+C;AAC/C,qDAAqD;AACrD,qDAAqD;AACrD,iDAAiD;AACjD,iDAAiD;AACjD,yDAAyD;AACzD,6DAA6D;AAC7D,+EAA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AC,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { test } from '@playwright/test';\nimport type {\n FormConfig,\n AnyFieldConfig,\n InputFieldConfig,\n TextareaFieldConfig,\n CheckboxFieldConfig,\n SelectFieldConfig,\n SliderFieldConfig,\n DatepickerFieldConfig,\n AutocompleteFieldConfig,\n AutocompleteChiplistFieldConfig,\n FileUploadFieldConfig,\n UnitConversionFieldConfig,\n} from '@tft/crispr-forms';\nimport { testInputField } from './input.tests';\nimport { testTextareaField } from './textarea.tests';\nimport { testCheckboxField } from './checkbox.tests';\nimport { testSelectField } from './select.tests';\nimport { testSliderField } from './slider.tests';\nimport { testDatepickerField } from './datepicker.tests';\nimport { testAutocompleteField } from './autocomplete.tests';\nimport { testAutocompleteChiplistField } from './autocomplete-chiplist.tests';\nimport { testFileUploadField } from './file-upload.tests';\nimport { testUnitConversionField } from './unit-conversion.tests';\n\n/**\n * Registers a `test.describe` block for a field config, automatically selecting\n * the correct test suite based on `controlType`.\n *\n * Non-control fields (heading, divider, button) are skipped silently.\n *\n * @example\n * ```ts\n * import { testField } from '@tft/crispr-forms-testing';\n * import { myFormConfig } from './my-form.config';\n *\n * test.describe('My Form', () => {\n * test.beforeEach(async ({ page }) => page.goto('/my-form'));\n * for (const field of myFormConfig.fields) {\n * testField(field);\n * }\n * });\n * ```\n */\nexport function testField(config: AnyFieldConfig) {\n if (!('controlName' in config)) return;\n\n test.describe(config.controlName, () => {\n switch (config.controlType) {\n case 'input':\n testInputField(config as InputFieldConfig);\n break;\n case 'textarea':\n testTextareaField(config as TextareaFieldConfig);\n break;\n case 'checkbox':\n testCheckboxField(config as CheckboxFieldConfig);\n break;\n case 'select':\n testSelectField(config as SelectFieldConfig);\n break;\n case 'slider':\n testSliderField(config as SliderFieldConfig);\n break;\n case 'datepicker':\n testDatepickerField(config as DatepickerFieldConfig);\n break;\n case 'autocomplete':\n testAutocompleteField(config as AutocompleteFieldConfig);\n break;\n case 'autocompleteChiplist':\n testAutocompleteChiplistField(config as AutocompleteChiplistFieldConfig);\n break;\n case 'fileUpload':\n testFileUploadField(config as FileUploadFieldConfig);\n break;\n case 'unitConversion':\n testUnitConversionField(config as UnitConversionFieldConfig);\n break;\n }\n });\n}\n\n/**\n * Registers a `testField` block for every field in a `FormConfig`.\n * Non-control fields (heading, divider, button) are skipped automatically.\n *\n * @example\n * ```ts\n * test.describe('My Form', () => {\n * test.beforeEach(async ({ page }) => page.goto('/my-form'));\n * testForm(myFormConfig);\n * });\n * ```\n */\nexport function testForm(config: FormConfig) {\n for (const field of config.fields) {\n testField(field);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { FileUploadFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { FileUploadFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for a FILE_UPLOAD field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.
@@ -1,26 +1,29 @@
1
- import { test, expect } from '@playwright/test';
2
- import { getLabel, getMatFormField } from '../helpers/form.helpers';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testFileUploadField = testFileUploadField;
4
+ const test_1 = require("@playwright/test");
5
+ const form_helpers_1 = require("../helpers/form.helpers");
3
6
  /**
4
7
  * Registers Playwright tests for a FILE_UPLOAD field config.
5
8
  * Call inside a `test.describe` block that has already navigated to the page.
6
9
  */
7
- export function testFileUploadField(config) {
10
+ function testFileUploadField(config) {
8
11
  if (config.label) {
9
- test('renders label', async ({ page }) => {
10
- await expect(getLabel(page, config.controlName)).toHaveText(config.label);
12
+ (0, test_1.test)('renders label', async ({ page }) => {
13
+ await (0, test_1.expect)((0, form_helpers_1.getLabel)(page, config.controlName)).toHaveText(config.label);
11
14
  });
12
15
  }
13
- test('shows drop zone text', async ({ page }) => {
16
+ (0, test_1.test)('shows drop zone text', async ({ page }) => {
14
17
  if (config.dropZoneText) {
15
- const dropZone = getMatFormField(page, config.controlName).locator('.drop-info');
16
- await expect(dropZone).toContainText(config.dropZoneText);
18
+ const dropZone = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('.drop-info');
19
+ await (0, test_1.expect)(dropZone).toContainText(config.dropZoneText);
17
20
  }
18
21
  });
19
- test('shows select files button', async ({ page }) => {
20
- const button = getMatFormField(page, config.controlName).locator('button');
21
- await expect(button).toBeVisible();
22
+ (0, test_1.test)('shows select files button', async ({ page }) => {
23
+ const button = (0, form_helpers_1.getMatFormField)(page, config.controlName).locator('button');
24
+ await (0, test_1.expect)(button).toBeVisible();
22
25
  if (config.selectButtonText) {
23
- await expect(button).toContainText(config.selectButtonText);
26
+ await (0, test_1.expect)(button).toContainText(config.selectButtonText);
24
27
  }
25
28
  });
26
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/file-upload.tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA6B;IAC/D,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC9C,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACjF,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2BAA2B,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACnD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3E,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { test, expect } from '@playwright/test';\nimport type { FileUploadFieldConfig } from '@tft/crispr-forms/utils';\nimport { getLabel, getMatFormField } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a FILE_UPLOAD field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testFileUploadField(config: FileUploadFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n test('shows drop zone text', async ({ page }) => {\n if (config.dropZoneText) {\n const dropZone = getMatFormField(page, config.controlName).locator('.drop-info');\n await expect(dropZone).toContainText(config.dropZoneText);\n }\n });\n\n test('shows select files button', async ({ page }) => {\n const button = getMatFormField(page, config.controlName).locator('button');\n await expect(button).toBeVisible();\n if (config.selectButtonText) {\n await expect(button).toContainText(config.selectButtonText);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"file-upload.tests.js","sourceRoot":"","sources":["../../../../libs/crispr-forms-testing/src/field-tests/file-upload.tests.ts"],"names":[],"mappings":";;AAQA,kDAqBC;AA7BD,2CAAgD;A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@tft/crispr-forms';\nimport { getLabel, getMatFormField } from '../helpers/form.helpers';\n\n/**\n * Registers Playwright tests for a FILE_UPLOAD field config.\n * Call inside a `test.describe` block that has already navigated to the page.\n */\nexport function testFileUploadField(config: FileUploadFieldConfig) {\n if (config.label) {\n test('renders label', async ({ page }) => {\n await expect(getLabel(page, config.controlName)).toHaveText(config.label);\n });\n }\n\n test('shows drop zone text', async ({ page }) => {\n if (config.dropZoneText) {\n const dropZone = getMatFormField(page, config.controlName).locator('.drop-info');\n await expect(dropZone).toContainText(config.dropZoneText);\n }\n });\n\n test('shows select files button', async ({ page }) => {\n const button = getMatFormField(page, config.controlName).locator('button');\n await expect(button).toBeVisible();\n if (config.selectButtonText) {\n await expect(button).toContainText(config.selectButtonText);\n }\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { InputFieldConfig } from '@tft/crispr-forms/utils';
1
+ import type { InputFieldConfig } from '@tft/crispr-forms';
2
2
  /**
3
3
  * Registers Playwright tests for an INPUT field config.
4
4
  * Call inside a `test.describe` block that has already navigated to the page.