From d83f9ee4a93fd68553edc534c0b140696f8b2a32 Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Thu, 11 Apr 2024 17:17:10 +0200 Subject: [PATCH] test(ct-angular): improve output listener update test --- tests/components/ct-angular/tests/events.spec.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/components/ct-angular/tests/events.spec.ts b/tests/components/ct-angular/tests/events.spec.ts index b11194ab90..38b50d0dc7 100644 --- a/tests/components/ct-angular/tests/events.spec.ts +++ b/tests/components/ct-angular/tests/events.spec.ts @@ -19,29 +19,27 @@ test('emit an submit event when the button is clicked', async ({ mount }) => { test('replace existing listener when new listener is set', async ({ mount, }) => { - let count = 0; + let called = false; const component = await mount(ButtonComponent, { props: { title: 'Submit', }, on: { - submit() { - count++; - }, + submit() {}, }, }); component.update({ on: { submit() { - count++; + called = true; }, }, }); await component.click(); - expect(count).toBe(1); + expect(called).toBe(true); }); test('unsubscribe from events when the component is unmounted', async ({