슬래시 미일치 Enter 동작 보정
This commit is contained in:
@@ -14,6 +14,8 @@ import {
|
||||
parseSlashInput,
|
||||
removeSlashSuppressedLine,
|
||||
resolveSlashCommand,
|
||||
resolveSlashCommandFromInputValue,
|
||||
shouldCaptureSlashMenuKeyboardAction,
|
||||
shouldIgnorePendingMediaSlashCommit
|
||||
} from '../lib/markdown-slash-commands.js'
|
||||
|
||||
@@ -29,6 +31,9 @@ test('슬래시 입력은 단일 줄 명령만 파싱한다', () => {
|
||||
test('정확한 슬래시 명령과 미디어 액션을 판별한다', () => {
|
||||
assert.equal(resolveSlashCommand('image')?.action, 'media-image')
|
||||
assert.equal(resolveSlashCommand('img')?.id, 'image')
|
||||
assert.equal(resolveSlashCommandFromInputValue('/image')?.id, 'image')
|
||||
assert.equal(resolveSlashCommandFromInputValue('/ㄴㅇ'), null)
|
||||
assert.equal(resolveSlashCommandFromInputValue(' /image'), null)
|
||||
assert.equal(isMediaSlashAction('media-image'), true)
|
||||
assert.equal(isMediaSlashAction('lines'), false)
|
||||
assert.equal(getMediaPickerKindFromSlashAction('media-image'), 'image')
|
||||
@@ -146,6 +151,33 @@ test('슬래시 메뉴 키보드 입력은 메뉴 동작으로 분류한다', ()
|
||||
assert.equal(getSlashMenuKeyboardAction('Tab'), '')
|
||||
})
|
||||
|
||||
test('슬래시 메뉴 키보드 입력은 적용 가능한 명령이 있을 때만 가로챈다', () => {
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: 'navigate',
|
||||
commandCount: 2
|
||||
}), true)
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: 'apply',
|
||||
commandCount: 1
|
||||
}), true)
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: 'navigate',
|
||||
commandCount: 0
|
||||
}), false)
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: 'apply',
|
||||
commandCount: 0
|
||||
}), false)
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: 'cancel',
|
||||
commandCount: 0
|
||||
}), true)
|
||||
assert.equal(shouldCaptureSlashMenuKeyboardAction({
|
||||
action: '',
|
||||
commandCount: 1
|
||||
}), false)
|
||||
})
|
||||
|
||||
test('슬래시 명령 줄에 미디어를 삽입할 때 원문 줄을 교체한다', () => {
|
||||
const markdown = [
|
||||
'첫 줄',
|
||||
|
||||
Reference in New Issue
Block a user