forked from pingdotgg/t3code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppSidebarLayout.test.ts
More file actions
35 lines (31 loc) · 956 Bytes
/
Copy pathAppSidebarLayout.test.ts
File metadata and controls
35 lines (31 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { describe, expect, it } from "vitest";
import { shouldAcceptThreadSidebarWidth } from "./AppSidebarLayout";
describe("shouldAcceptThreadSidebarWidth", () => {
it("allows shrinking even when the sidebar is wider than the available content area", () => {
expect(
shouldAcceptThreadSidebarWidth({
currentWidth: 900,
nextWidth: 800,
wrapperClientWidth: 700,
}),
).toBe(true);
});
it("rejects expansion that would leave less than the minimum main content width", () => {
expect(
shouldAcceptThreadSidebarWidth({
currentWidth: 500,
nextWidth: 600,
wrapperClientWidth: 1_000,
}),
).toBe(false);
});
it("allows expansion when the main content minimum remains available", () => {
expect(
shouldAcceptThreadSidebarWidth({
currentWidth: 300,
nextWidth: 340,
wrapperClientWidth: 1_000,
}),
).toBe(true);
});
});