Skip to content

Commit

Permalink
test: updated calendar component unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c committed Apr 8, 2024
1 parent 7eba70c commit e94aeee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
exports[`Test: KCalendar > events: panelChange 1`] = `
{
"date": "2024-04-07",
"source": undefined,
"mode": "month",
}
`;

exports[`Test: KCalendar > events: panelChange 2`] = `
{
"date": "2024-04-07",
"source": undefined,
"mode": "year",
}
`;

Expand Down
7 changes: 5 additions & 2 deletions components/Calendar/__test__/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,17 @@ describe('Test: KCalendar', () => {
//@ts-ignore
const instance = new KCalendar({
target: host,
value: dayjs('2024-04-07')
props: {
value: dayjs('2024-04-07')
}
});
expect(instance).toBeTruthy();
await tick();
//@ts-ignore
instance.$on('panelChange', (e: CustomEvent) => {
data = {
date: e.detail.date.format('YYYY-MM-DD'),
source: e.detail.source
mode: e.detail.mode
};
mockFn();
});
Expand Down

0 comments on commit e94aeee

Please sign in to comment.