Behaviour SwRS-MDOKFSTUDIO-BLOCK-265
Delete block deletes the blocks of a selection with one separator in one undo step
When the writer clicks the Delete block button of a block, or presses Delete or Backspace on a block selection, the extension SHALL delete the blocks of the selection (or the one block) with their trailing blank lines and one separator in one edit and one undo step, refuse an included block, and select the block that took the place.
Part of StRS-MDOKFSTUDIO-BLOCK-011, outside the paths drawn on its map.
Part of StRS-MDOKFSTUDIO-BLOCK-025, outside the paths drawn on its map.
Scenarios 5
The situations the tests check; open one to read it.
nominalThe button and the keys
Givenedit mode on, three blocks and a block selection on the second
Whenthe writer presses Delete or Backspace, or clicks the Delete block button of the bar of the second block
Thenthe page posts previewBlocksDelete for the selected lines, the host deletes them with one separator in one edit, and the selection goes to the block that took their place
nominalThe button in the bar
Giventhe bar of a body block
Whenit is shown
Thena "Delete block" button sits right after the down arrow and touches it, the move status sits to its right and never overlaps it, the button is hidden while a block editor is open, and an included block, the properties bar and the Start writing entry have none
nominalThe keys act on a block selection only
Givenonly a focused block, a focused bar button, a text box, an open editor, or the structural cursor on a cell, a list item or an inner block
Whenthe writer presses Delete or Backspace
Thennothing is posted
nominalRefusals and the selection after the delete
Givena span that opens an {include} directive, lines out of date or in the frontmatter, or an open block edit on the host
Whenthe delete is requested
Thenthe document does not change and the refusal is shown next to the selection ("A block that comes from an included file cannot be deleted." for an include)
after a successful delete the following block is selected, else the block above, else the Start writing button has the focus
after a successful delete the following block is selected, else the block above, else the Start writing button has the focus
nominalA blank-line block
Givena selected blank-line block
Whenthe writer presses Delete or Backspace or clicks its Delete block button
ThenpreviewBlankRunDelete removes that one blank line and the separator stays (see SwRS-MDOKFSTUDIO-BLOCK-269)
Implemented in 7
Tested by 7
- test/core/edits/blocksDelete.test.tsunit
- test/core/preview/blockReq.requirements.test.tsunit
- test/integration/emptyBlocks.test.tsintegration
- test/page/runtimeBlockDelete.test.tsunit
- test/session/emptiedBlockDelete.test.tsunit
- test/visual/capture_delete_block_bar.pyvisual
- test/visual/deleteBlockBarScenarios.tsvisual