Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rain-Zheng committed Jun 26, 2024
1 parent b719ece commit e6ce9d0
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ describe('EditPlugin', () => {
expect(keyboardDeleteSpy).not.toHaveBeenCalled();
expect(keyboardEnterSpy).not.toHaveBeenCalled();
});

it('Tab, Tab handling not enabled', () => {
plugin = new EditPlugin({
handleTabKey: false,
});
const rawEvent = { key: 'Tab' } as any;

plugin.initialize(editor);

plugin.onPluginEvent({
eventType: 'keyDown',
rawEvent,
});

expect(keyboardTabSpy).not.toHaveBeenCalled();
expect(keyboardInputSpy).not.toHaveBeenCalled();
expect(keyboardDeleteSpy).not.toHaveBeenCalled();
expect(keyboardEnterSpy).not.toHaveBeenCalled();
});

it('Enter, normal enter not enabled', () => {
plugin = new EditPlugin();
Expand Down

0 comments on commit e6ce9d0

Please sign in to comment.