Open saif-webonise opened 2 months ago
Describe the bug while writing test cases lexical-beautiful-mentions throw below error. 1- got error in zeroWidthPlugin
2- q.getType is not a function
please provide us the solution how to mock lexical-beautiful-mentions
jest.mock('lexical-beautiful-mentions', () => ({ BeautifulMentionNode: () => ({ trigger: '', value: '', __data: {}, createDOM: jest.fn(), updateDOM: jest.fn(), exportDOM: jest.fn(), exportJSON: jest.fn(), getTextContent: jest.fn(), getTrigger: jest.fn(), getValue: jest.fn(), setValue: jest.fn(), getData: jest.fn(), setData: jest.fn(), component: jest.fn(), decorate: jest.fn(), getType: jest.fn(), getCssClassesFromTheme: jest.fn(), }), matchMedia: true, BeautifulMentionsItem: jest.fn(), useBeautifulMentions: () => ({ insertMention: jest.fn(), }), ZeroWidthPlugin: jest.fn(), }));
This issue is stale because it has been open for 60 days with no activity.
Describe the bug while writing test cases lexical-beautiful-mentions throw below error. 1- got error in zeroWidthPlugin
2- q.getType is not a function
please provide us the solution how to mock lexical-beautiful-mentions
jest.mock('lexical-beautiful-mentions', () => ({ BeautifulMentionNode: () => ({ trigger: '', value: '', __data: {}, createDOM: jest.fn(), updateDOM: jest.fn(), exportDOM: jest.fn(), exportJSON: jest.fn(), getTextContent: jest.fn(), getTrigger: jest.fn(), getValue: jest.fn(), setValue: jest.fn(), getData: jest.fn(), setData: jest.fn(), component: jest.fn(), decorate: jest.fn(), getType: jest.fn(), getCssClassesFromTheme: jest.fn(), }), matchMedia: true, BeautifulMentionsItem: jest.fn(), useBeautifulMentions: () => ({ insertMention: jest.fn(), }), ZeroWidthPlugin: jest.fn(), }));