([\s\S]*?)<\/div>/.exec(topBar)?.[1];
+ assert.ok(right, "expected the top bar to have its buttons in a right-hand group");
+
+ assert.match(right, /href="\/docs"/, "the top bar has to link to /docs");
+ assert.match(right, /main-menu\.documentation/, "under the same label the main menu uses");
+
+ // To the left of the settings button: the group is read left to right, so the link has to
+ // come first in it.
+ const docsAt = right.indexOf('href="/docs"');
+ const settingsAt = right.indexOf("OpenCampaignSettings");
+ assert.ok(
+ docsAt !== -1 && settingsAt !== -1 && docsAt < settingsAt,
+ "the documentation button sits on the left of the settings button"
+ );
+
+ // /docs is another page, and the open notes of the campaign live only in memory, so the link
+ // opens it somewhere that does not throw the campaign away.
+ assert.match(right, /target="_blank"/, "the campaign stays as it was behind the documentation");
+ assert.match(right, /rel="[^"]*noopener/, "a tab the app does not control must not be able to reach it");
+
+ // The link is an `
` and the buttons are styled by element, so it carries its own look, in
+ // theme colours like everything else.
+ const look = /\.docs-button\s*\{[^}]*\}/.exec(topBar)?.[0];
+ assert.ok(look, "the documentation link has to look like the buttons next to it");
+ for (const declaration of [
+ "background-color: var\\(--color-button-background\\)",
+ "color: var\\(--color-text\\)",
+ "border: solid 1px var\\(--color-border\\)",
+ ]) {
+ assert.match(look, new RegExp(declaration), "the link's look uses the theme's colours");
+ }
+});
+
// --- How the documentation is laid out (Syndria98/dragonroll#85) ---
// The `