test(ui): the px-box probe does not trip its own rule; tsc lib-safe last()
The pxBox contract test held the literal w-[150px] it probes, which the new lint rule refuses, and stickyTop's test used Array.at, outside the tsconfig lib. Both landed because a local lane check piped its exit code into tail.
This commit is contained in:
@@ -22,6 +22,8 @@ vi.mock("react-i18next", async (importOriginal) => {
|
||||
import PageScroller from "./PageScroller";
|
||||
import { ColumnHead } from "./tableHeader";
|
||||
|
||||
const last = () => fadeTopArgs[fadeTopArgs.length - 1];
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
fadeTopArgs.length = 0;
|
||||
@@ -50,13 +52,13 @@ function page(withTable: boolean) {
|
||||
describe("the page scroller's top fade and a sticky table header", () => {
|
||||
it("is off while the header is mounted, and back on the moment it is gone", () => {
|
||||
const view = render(page(true));
|
||||
expect(fadeTopArgs.at(-1)).toBe(false);
|
||||
expect(last()).toBe(false);
|
||||
view.rerender(page(false)); // e.g. the Channels card layout, or a narrow DataTable
|
||||
expect(fadeTopArgs.at(-1)).toBe(true);
|
||||
expect(last()).toBe(true);
|
||||
});
|
||||
|
||||
it("is on for a page with no sticky header at all", () => {
|
||||
render(page(false));
|
||||
expect(fadeTopArgs.at(-1)).toBe(true);
|
||||
expect(last()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user