Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-THEME-038

Zoom in and out change the zoom by 10 points within limits

When the reader presses the Zoom in button below 200 % or the Zoom out button above 70 %, the extension SHALL change the zoom by 10 percentage points, set the zoom variable and the html attribute data-sphinx-preview-zoom to the new value, name the value of the next click in the button tooltips and disable the button at its limit.

Step 1 of path 1 in StRS-MDOKFSTUDIO-THEME-011: from “The page is shown at a zoom” to “The zoom has changed”.

Scenarios 8

The situations the tests check; open one to read it.

nominalZoom in, one step
Givena page at 100 % and the Zoom in button on toolbar row 3 (accessible name "Zoom in")
Whenthe button is clicked
Then--sphinx-preview-zoom is 1.1, data-sphinx-preview-zoom is 110 and one previewViewPreferenceChanged message with value 110 is posted (stored under SwRS-MDOKFSTUDIO-LIFE-169)
boundaryZoom in, last step
Givena page at 190 %
Whenthe button is clicked
Thenthe zoom is 200 and the button is disabled
nominalZoom out, two steps
Givena page at 110 % and the Zoom out button on toolbar row 3 (accessible name "Zoom out")
Whenthe button is clicked twice
Thendata-sphinx-preview-zoom reads 100, then 90 and the last posted message carries the value 90
boundaryZoom out, last step
Givena page at 80 %
Whenthe button is clicked
Thenthe zoom is 70, --sphinx-preview-zoom is 0.7 and the button is disabled
boundaryThe zoom a page starts at
Givena page start as in the table
Whenthe page starts
Thenthe zoom is the one in the table (the stored and saved values are chosen under SwRS-MDOKFSTUDIO-LIFE-170)
InputOutcome
No panel state and no initial view preference--sphinx-preview-zoom is 1, data-sphinx-preview-zoom is 100 and both zoom buttons are enabled
An initial zoom that is not a finite numberThe zoom is 100
nominalThe tooltips name the value a click gives
Givena page at a zoom as in the table
Whenthe title and data-tooltip of each zoom button are read
Thenthey are set together and equal the texts in the table; the accessible name stays "Zoom in" and "Zoom out" at every value
InputZoom inZoom out
Page at 100 %Zoom in (110 %)Zoom out (90 %)
Page at 100 % after one click on Zoom inZoom in (120 %)Zoom out (100 %)
Page at 70 %Zoom in (80 %)Zoom out (minimum 70 %)
Page at 200 %Zoom in (maximum 200 %)Zoom out (190 %)
refusalA click at a limit changes nothing
Givena page at 70 %, and a page started at 200 %
Whenthe Zoom out button of the first page is read and clicked, and the Zoom in button of the second page is read
Thenthe Zoom out button is disabled, the zoom stays 70 and no message is posted; the Zoom in button is disabled, --sphinx-preview-zoom is 2 and Zoom out is enabled
nominalA zoom change keeps the reading line
Givena page scrolled to a paragraph, with no scroll anchor set or with a scroll anchor already set
Whenthe reader changes the zoom
Thenwithout an anchor the page takes the source line at the reading line as its anchor and applies it after the layout changed, so the same text stays at the reading line; with an anchor the existing anchor is kept and applied again

Implemented in 1

Tested by 2