diff --git a/assets/js/__tests__/upload.spec.ts b/assets/js/__tests__/upload.spec.ts index 233bcd83..f58132f1 100644 --- a/assets/js/__tests__/upload.spec.ts +++ b/assets/js/__tests__/upload.spec.ts @@ -25,6 +25,8 @@ const errorResponse = { }; /* eslint-enable camelcase */ +const tagSets = ['safe', 'one, two, three', 'safe, expicit', 'safe, two, three']; + describe('Image upload form', () => { let mockPng: File; let mockWebm: File; @@ -87,7 +89,7 @@ describe('Image upload form', () => { -
+
@@ -212,6 +214,14 @@ describe('Image upload form', () => { }); it('should prevent form submission if tag checks fail', async () => { + tagSets.forEach(tags => { + taginputEl.value = tags; + //TODO fire submit event + // check whether the form fully submitted or was prevented by tag checks + // verify the number of error help blocks added + // check if the submit button is enabled/disabled + }); + await new Promise(resolve => { form.addEventListener('submit', event => { event.preventDefault();