슬래시 명령 효과 계획 분리
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
addSlashSuppressedLine,
|
||||
clampSlashHighlightedIndex,
|
||||
createSlashCommandApplyPlan,
|
||||
createSlashCommandEditorEffectPlan,
|
||||
getMediaPickerKindFromSlashAction,
|
||||
getNextSlashHighlightedIndex,
|
||||
getSlashCommandFocusTarget,
|
||||
@@ -91,6 +92,64 @@ test('슬래시 명령 적용 계획은 적용할 수 없는 입력을 무시한
|
||||
})
|
||||
})
|
||||
|
||||
test('슬래시 명령 에디터 효과 계획은 미디어 모달 실행을 유지한다', () => {
|
||||
const applyPlan = createSlashCommandApplyPlan({
|
||||
command: resolveSlashCommand('image'),
|
||||
sourceLine: 2
|
||||
})
|
||||
|
||||
assert.deepEqual(createSlashCommandEditorEffectPlan({
|
||||
plan: applyPlan,
|
||||
activeMode: 'preview'
|
||||
}), {
|
||||
kind: 'media',
|
||||
line: 2,
|
||||
mediaKind: 'image'
|
||||
})
|
||||
})
|
||||
|
||||
test('슬래시 명령 에디터 효과 계획은 모드별 포커스 대상을 계산한다', () => {
|
||||
const applyPlan = createSlashCommandApplyPlan({
|
||||
command: resolveSlashCommand('code'),
|
||||
sourceLine: 5
|
||||
})
|
||||
|
||||
assert.deepEqual(createSlashCommandEditorEffectPlan({
|
||||
plan: applyPlan,
|
||||
activeMode: 'write'
|
||||
}), {
|
||||
kind: 'lines',
|
||||
line: 5,
|
||||
lines: ['```', '', '```'],
|
||||
focusTarget: 'textarea'
|
||||
})
|
||||
|
||||
assert.deepEqual(createSlashCommandEditorEffectPlan({
|
||||
plan: applyPlan,
|
||||
activeMode: 'preview'
|
||||
}), {
|
||||
kind: 'lines',
|
||||
line: 5,
|
||||
lines: ['```', '', '```'],
|
||||
focusTarget: 'preview'
|
||||
})
|
||||
})
|
||||
|
||||
test('슬래시 명령 에디터 효과 계획은 무효 계획을 무시한다', () => {
|
||||
assert.deepEqual(createSlashCommandEditorEffectPlan({
|
||||
plan: { kind: 'none' },
|
||||
activeMode: 'write'
|
||||
}), {
|
||||
kind: 'none'
|
||||
})
|
||||
assert.deepEqual(createSlashCommandEditorEffectPlan({
|
||||
plan: null,
|
||||
activeMode: 'preview'
|
||||
}), {
|
||||
kind: 'none'
|
||||
})
|
||||
})
|
||||
|
||||
test('미디어 슬래시 명령 지연 commit은 같은 줄 slash 원문일 때만 무시한다', () => {
|
||||
assert.equal(shouldIgnorePendingMediaSlashCommit({
|
||||
pendingInsertLine: 3,
|
||||
|
||||
Reference in New Issue
Block a user