Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-120
The Anchor button switches whether the preview follows the editor
When the reader presses the enabled Anchor button, or the page learns whether a text editor shows its document, the extension SHALL show the anchor mode and the pairing on the button (data-anchor-mode, aria-pressed, label, title and tooltip, disabled while no text editor shows the file) and, when the mode is turned on, post to the preview the first visible line of each visible text editor that shows its document; a pairing message for another document, document version or request than the page's leaves the button unchanged, and the host accepts a mode change only when anchorToEditor is a boolean.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-013: from “The Anchor button is enabled” to “The preview and the text editor scroll together”.
Scenarios 11
The situations the tests check; open one to read it.
nominalThe button switches the mode
| Input | Outcome |
|---|---|
| the enabled Anchor button in the off mode, pressed | data-anchor-mode is on, aria-pressed is true, the title and tooltip say Preview and text editor scroll together |
| the button in the on mode, pressed | data-anchor-mode is off, aria-pressed is false, the title and tooltip say Preview and text editor scroll independently |
boundaryInitial state
refusalNo text editor shows the file
nominalA text editor shows the file
| Input | Outcome |
|---|---|
| a disabled Anchor button, previewPairing with pairedTextEditor true | the button is enabled, its label is restored to Anchor preview to text editor and its title and tooltip show the mode of the moment |
| an enabled Anchor button, previewPairing with pairedTextEditor true | the button stays enabled and keeps its mode |
boundaryPairing message without the field
nominalTurning the mode on aligns the preview
boundaryTurning the mode off
refusalForeign document
| Input | Outcome |
|---|---|
| a message for another document identity | the button does not change |
| a message for another document version or another request | the button does not change |
nominalOwn document
nominalBoolean
refusalNot a boolean
Implemented in 4
Tested by 7
- test/core/preview/toolbarReq.requirements.test.tsunit
- test/core/protocol/pageStateMessages.test.tsunit
- test/integration/previewEditing.test.tsintegration
- test/page/runtimePageControls.test.tsunit
- test/page/runtimeScroll.test.tsunit
- test/page/toolbarReq.runtime.requirements.test.tsunit
- test/session/toolbarReq.requirements.test.tsunit