Skip to content

Commit

Permalink
test: add test for sticky note color change in toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed Sep 5, 2024
1 parent 0ae67a2 commit c05f73f
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,26 @@ describe('CanvasNodeToolbar', () => {

expect(emitted('open:contextmenu')[0]).toEqual([expect.any(MouseEvent)]);
});

it('should emit "update" when sticky note color is changed', async () => {
const { getAllByTestId, getByTestId, emitted } = renderComponent({
global: {
provide: {
...createCanvasNodeProvide({
data: {
render: {
type: CanvasNodeRenderType.StickyNote,
options: { color: 3 },
},
},
}),
},
},
});

await fireEvent.click(getByTestId('change-sticky-color'));
await fireEvent.click(getAllByTestId('color')[0]);

expect(emitted('update')[0]).toEqual([{ color: 1 }]);
});
});

0 comments on commit c05f73f

Please sign in to comment.