mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
feat: Added Context Menu for markdown preview mode and copy url when hyperlink
This commit is contained in:
committed by
Junyoung Choi
parent
c83e5cc7d8
commit
e85767b4a0
@@ -5,11 +5,13 @@ jest.mock('electron', () => {
|
||||
|
||||
const spellcheck = require('browser/lib/spellcheck')
|
||||
const buildEditorContextMenu = require('browser/lib/contextMenuBuilder')
|
||||
const buildMarkdownPreviewContextMenu = require('browser/lib/contextMenuBuilder')
|
||||
|
||||
beforeEach(() => {
|
||||
menuBuilderParameter = null
|
||||
})
|
||||
|
||||
// Editor Context Menu
|
||||
it('should make sure that no context menu is build if the passed editor instance was null', function () {
|
||||
const event = {
|
||||
pageX: 12,
|
||||
@@ -124,3 +126,13 @@ it('should make sure that word suggestions creates a correct menu if there was a
|
||||
expect(menuBuilderParameter[7].role).toEqual('selectall')
|
||||
expect(spellcheck.getSpellingSuggestion).toHaveBeenCalledWith(wordToCorrect)
|
||||
})
|
||||
|
||||
// Markdown Preview Context Menu
|
||||
it('should make sure that no context menu is built if the Markdown Preview instance was null', function () {
|
||||
const event = {
|
||||
pageX: 12,
|
||||
pageY: 12
|
||||
}
|
||||
buildMarkdownPreviewContextMenu(null, event)
|
||||
expect(menuBuilderParameter).toEqual(null)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user