Behaviour SwRS-MDOKFSTUDIO-TOOLBAR-033
The Table of contents button shows and hides the column
When the reader presses the Table of contents button, the extension SHALL toggle the open state of the column, set the button's aria-pressed, label, title and tooltip to Hide table of contents when open or Show table of contents when closed, set the attribute data-sphinx-preview-toc of the page root to open or closed, and run the layout update for the changed available width once.
Step 1 of path 1 in StRS-MDOKFSTUDIO-TOOLBAR-006: from “The page is shown without the table of contents” to “The column is open”.
Scenarios 4
The situations the tests check; open one to read it.
nominalOpen then close
Givena closed column
Whenthe button is pressed, then pressed again
Thenthe column opens with aria-pressed true and the label Hide table of contents, then closes with aria-pressed false and the label Show table of contents
boundaryInitial state
Giventhe toolbar markup before the page script runs, and a page with no stored choice
Whenthe button is read and the page starts
Thenaria-pressed is false, the label is Show table of contents and the root attribute is closed
nominalRoot attribute follows each press
Givena page with the column closed
Whenthe button is pressed twice
Thendata-sphinx-preview-toc of the root is open after the first press and closed after the second
nominalEach press runs the layout update once
Givena closed column
Whenthe button is pressed
the button is pressed again on the open column
the button is pressed again on the open column
Thenthe change callback runs once
the callback runs once more
the callback runs once more