Behaviour SwRS-MDOKFSTUDIO-THEME-001
The Theme button cycles Current, Dark, White and Cream
When the reader presses the Theme button, the extension SHALL switch the preview theme mode in the order Current, Dark, White, Cream and back to Current, and show the active mode and the next one on the button.
Step 1 of path 1 in StRS-MDOKFSTUDIO-THEME-002: from “The page is shown in one theme mode” to “A theme mode is active”.
Part of StRS-MDOKFSTUDIO-THEME-004, outside the paths drawn on its map.
Scenarios 5
The situations the tests check; open one to read it.
nominalFour clicks
Giventhe page in Current mode (a workspace that stored Current) and the Theme button on toolbar row 2
Whenthe button is clicked four times
Thenthe attribute data-sphinx-preview-theme-mode of the html element reads dark, white, cream and current in turn, and the attribute data-theme-mode of the button follows it
boundaryWrap-around from Cream
Giventhe page in Cream mode (the default of a fresh workspace)
Whenthe button is clicked once
Thenthe mode is Current again; the cycle never stops at Cream and never skips a mode
nominalThe button names the active mode and the next one
Giventhe page in any theme mode
Whenthe button attributes are read
Thenaria-label reads "Preview theme: {Mode} theme" and title and data-tooltip both read "{Mode} theme (click for {next mode} theme)", with the next mode name in lower case, as in the table
| Mode shown | aria-label | title and data-tooltip |
|---|---|---|
| Current | Preview theme: Current theme | Current theme (click for dark theme) |
| Dark | Preview theme: Dark theme | Dark theme (click for white theme) |
| White | Preview theme: White theme | White theme (click for cream theme) |
| Cream (fresh workspace) | Preview theme: Cream theme | Cream theme (click for current theme) |
nominalOne icon per mode
Giventhe toolbar markup and the page in Cream mode on a dark VS Code theme (visual scenario theme-zoom/v02)
Whenthe visible icons of the Theme button are listed
Thenexactly one icon is displayed and its data-theme-icon is cream; on a light host forced to Dark (visual scenario theme-zoom/v08) it is dark
boundaryIcon set is well formed
Giventhe markup of the Theme button
Whenits children are read
Thenthe button holds exactly four svg icons (current, dark, white and a cream coffee cup), in the order current, dark, white, cream, none nested in another, and nothing else