Skip to content

Commit

Permalink
test: prevent date-was-clicked event on clicking event
Browse files Browse the repository at this point in the history
  • Loading branch information
tomosterlund committed Dec 1, 2023
1 parent 4cce056 commit 4ff82ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/unit/components/month/Day.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ describe("Day.vue", () => {
expect(underTest.emitted("date-was-clicked")[0][0]).toBe("2022-05-23");
});

it('should not emit "date-was-clicked" when an event is clicked', () => {
const underTest = day({ props: defaultProps });
const dayEvent = underTest.find(".calendar-month__event");

dayEvent.trigger("click");

expect(underTest.emitted("date-was-clicked")).toBeFalsy();
})

it('should not emit custom event "day-was-selected" when qalendar !isSmall and a day is clicked', async () => {
const underTest = day({ props: {
...defaultProps,
Expand Down

0 comments on commit 4ff82ad

Please sign in to comment.