diff --git a/src/www/views/contact_view/index.spec.ts b/src/www/views/contact_view/index.spec.ts index 247ff2ceb59..76a082da740 100644 --- a/src/www/views/contact_view/index.spec.ts +++ b/src/www/views/contact_view/index.spec.ts @@ -115,19 +115,19 @@ describe('ContactView', () => { expect(supportForm).not.toBeNull(); }); - it('emits contact success event on completion of support form', async () => { - const listener = oneEvent(el, 'SupportContacted'); + it('emits success event on completion of support form', async () => { + const listener = oneEvent(el, 'success'); const supportForm: SupportForm = el.shadowRoot!.querySelector('support-form')!; supportForm.valid = true; supportForm.dispatchEvent(new CustomEvent('submit')); const {detail} = await listener; - expect(detail).toBeTrue(); + expect(detail).toBeNull(); }); - it('emits contact failure event when feedback reporting fails', async () => { - const listener = oneEvent(el, 'SupportContacted'); + it('emits failure event when feedback reporting fails', async () => { + const listener = oneEvent(el, 'error'); mockErrorReporter.report.and.throwError('fail'); const supportForm: SupportForm = el.shadowRoot!.querySelector('support-form')!; @@ -135,7 +135,7 @@ describe('ContactView', () => { supportForm.dispatchEvent(new CustomEvent('submit')); const {detail} = await listener; - expect(detail).toBeFalse(); + expect(detail).toBeNull(); }); it('shows default contact view on cancellation of support form', async () => { diff --git a/src/www/views/contact_view/index.ts b/src/www/views/contact_view/index.ts index d1b425c5b89..64abbe0f88a 100644 --- a/src/www/views/contact_view/index.ts +++ b/src/www/views/contact_view/index.ts @@ -210,13 +210,13 @@ export class ContactView extends LitElement { } catch (e) { console.error(`Failed to send feedback report: ${e.message}`); this.isFormSubmitting = false; - this.dispatchEvent(new CustomEvent('error', {bubbles: true, composed: true})); + this.dispatchEvent(new CustomEvent('error')); return; } this.isFormSubmitting = false; - this.dispatchEvent(new CustomEvent('success', {bubbles: true, composed: true})); this.reset(); + this.dispatchEvent(new CustomEvent('success')); } private get renderIntroTemplate(): TemplateResult {