|
1 | 1 | import { describe, expect, it } from "vite-plus/test"; |
2 | 2 |
|
3 | 3 | import { restoreSettingsLinkState } from "../settings/settings-navigation"; |
4 | | -import { workspaceSelectionsIn, workspaceTabNavigationState } from "./workspace-tab-navigation"; |
| 4 | +import { |
| 5 | + workspaceSelectionsIn, |
| 6 | + workspaceTabColumns, |
| 7 | + workspaceTabNavigationState, |
| 8 | +} from "./workspace-tab-navigation"; |
5 | 9 |
|
6 | 10 | const home = { key: "home", name: "Home" }; |
7 | 11 | const thread = { |
@@ -47,6 +51,36 @@ describe("workspace tab selections", () => { |
47 | 51 | describe("opening a workspace tab", () => { |
48 | 52 | const columns = { columns: true, check: available }; |
49 | 53 |
|
| 54 | + it("opens Android Settings beside its default page only in a wide window", () => { |
| 55 | + const open = (wide: boolean) => |
| 56 | + workspaceTabNavigationState( |
| 57 | + { routes: [home, thread] }, |
| 58 | + "settings", |
| 59 | + {}, |
| 60 | + { |
| 61 | + columns: workspaceTabColumns("android", "settings", wide), |
| 62 | + check: available, |
| 63 | + }, |
| 64 | + ); |
| 65 | + expect(names(open(false))).toEqual(["Home", "Settings"]); |
| 66 | + expect(names(open(true))).toEqual(["Home", "Settings", "SettingsEnvironments"]); |
| 67 | + }); |
| 68 | + |
| 69 | + it("keeps Android list tabs and iOS remembered-detail navigation unchanged", () => { |
| 70 | + const open = (platform: string) => |
| 71 | + workspaceTabNavigationState( |
| 72 | + { routes: [home, thread] }, |
| 73 | + "threads", |
| 74 | + { threads: thread.params }, |
| 75 | + { |
| 76 | + columns: workspaceTabColumns(platform, "threads", true), |
| 77 | + check: available, |
| 78 | + }, |
| 79 | + ); |
| 80 | + expect(names(open("android"))).toEqual(["Home"]); |
| 81 | + expect(names(open("ios"))).toEqual(["Home", "Thread"]); |
| 82 | + }); |
| 83 | + |
50 | 84 | it("opens the remembered page beside the list with columns, and the list without", () => { |
51 | 85 | const state = { routes: [home, thread] }; |
52 | 86 | const selections = { threads: thread.params, pullRequests: pullRequest.params }; |
|
0 commit comments