|
7 | 7 | find, |
8 | 8 | settled, |
9 | 9 | triggerKeyEvent, |
| 10 | + blur, |
10 | 11 | waitUntil, |
11 | 12 | findAll, |
12 | 13 | } from '@ember/test-helpers'; |
@@ -877,33 +878,31 @@ module('Registries | Acceptance | draft form', hooks => { |
877 | 878 | .hasValue(new Date().getUTCFullYear().toString(), 'License: Year autofills to current year'); |
878 | 879 | assert.dom('[data-test-required-field="copyrightHolders"]') |
879 | 880 | .hasText('', 'License: CopyrightHolders does not autofill'); |
880 | | - const missingFields = 'Copyright Holders'; |
881 | | - const validationErrorMsg = t('validationErrors.node_license_missing_fields', |
| 881 | + let missingFields = 'Copyright Holders'; |
| 882 | + let validationErrorMsg = t('validationErrors.node_license_missing_fields', |
882 | 883 | { missingFields, numOfFields: 1 }).toString(); |
883 | 884 | assert.dom('[data-test-validation-errors="nodeLicense"]') |
884 | 885 | .containsText(validationErrorMsg, 'NodeLicense validation error when copyright holder is empty'); |
885 | 886 |
|
886 | | - // TODO: Fix node-license validation in test |
887 | 887 | // Input invalid Nodelicense fields |
888 | | - // await fillIn('[data-test-required-field="year"]', ''); |
889 | | - // await blur('[data-test-required-field="year"]'); |
890 | | - // await this.pauseTest(); |
891 | | - // missingFields = 'Year, Copyright Holders'; |
892 | | - // validationErrorMsg = t('validationErrors.node_license_missing_fields', |
893 | | - // { missingFields, numOfFields: 2 }).toString(); |
894 | | - // assert.dom('[data-test-validation-errors="nodeLicense"]') |
895 | | - // .containsText( |
896 | | - // validationErrorMsg, |
897 | | - // 'NodeLicense validation error when year and copyrightholder are empty', |
898 | | - // ); |
899 | | - // await percySnapshot( |
900 | | - // 'Registries | Acceptance | draft form | metadata editing | metadata: invalid nodelicense'); |
| 888 | + await fillIn('[data-test-required-field="year"]', ''); |
| 889 | + await blur('[data-test-required-field="year"]'); |
| 890 | + missingFields = 'Year, Copyright Holders'; |
| 891 | + validationErrorMsg = t('validationErrors.node_license_missing_fields', |
| 892 | + { missingFields, numOfFields: 2 }).toString(); |
| 893 | + assert.dom('[data-test-validation-errors="nodeLicense"]') |
| 894 | + .containsText( |
| 895 | + validationErrorMsg, |
| 896 | + 'NodeLicense validation error when year and copyrightholder are empty', |
| 897 | + ); |
| 898 | + await percySnapshot( |
| 899 | + 'Registries | Acceptance | draft form | metadata editing | metadata: invalid nodelicense', |
| 900 | + ); |
901 | 901 |
|
902 | 902 | // validation errors for nodelicense should show on review page |
903 | | - // await click('[data-test-link="review"]'); |
904 | | - // |
905 | | - // assert.dom('[data-test-validation-errors="nodeLicense"]').exists('NodeLicense errors exist on Review page'); |
906 | | - // await percySnapshot('Registries | Acceptance | draft form | metadata editing | review: invalid nodelicense'); |
| 903 | + await click('[data-test-link="review"]'); |
| 904 | + assert.dom('[data-test-validation-errors="nodeLicense"]').exists('NodeLicense errors exist on Review page'); |
| 905 | + await percySnapshot('Registries | Acceptance | draft form | metadata editing | review: invalid nodelicense'); |
907 | 906 |
|
908 | 907 | // Return to metadata page to address empty fields |
909 | 908 | await click('[data-test-link="metadata"]'); |
|
0 commit comments