Pin the review card description under the sections and tint the card from the uploaded logo.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2653ae4602
commit
56adcd59fd
10 files changed
+508
-42
No files matched your search
@@ -122,6 +122,43 @@ describe("FinalReviewScreen", () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("places the group description under the category rows", async () => {
|
||||
render(
|
||||
<FinalReviewWithFlowState
|
||||
title="Oak Park Commons"
|
||||
communityContext="Local mutual aid."
|
||||
/>,
|
||||
);
|
||||
const description = await screen.findByText(/Local mutual aid\./i);
|
||||
expect(
|
||||
screen.getByText("Values").compareDocumentPosition(description) &
|
||||
Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
).not.toBe(0);
|
||||
expect(description.parentElement).toHaveClass("border-t");
|
||||
});
|
||||
|
||||
it("uses a random light background when no logo is uploaded", async () => {
|
||||
render(
|
||||
<FinalReviewWithFlowState
|
||||
title="Oak Park Commons"
|
||||
communityContext="Local mutual aid."
|
||||
/>,
|
||||
);
|
||||
await waitFor(() => {
|
||||
const card = screen.getByRole("button", { name: /Oak Park Commons/i });
|
||||
const raw = card.style.backgroundColor;
|
||||
expect(raw).toMatch(/^rgb\(\d+, \d+, \d+\)$/);
|
||||
const channels = raw
|
||||
.split(/[^\d]+/)
|
||||
.filter(Boolean)
|
||||
.map(Number);
|
||||
const lightness =
|
||||
(Math.max(...channels) + Math.min(...channels)) / 2 / 255;
|
||||
expect(lightness).toBeGreaterThanOrEqual(0.74);
|
||||
expect(lightness).toBeLessThanOrEqual(0.9);
|
||||
});
|
||||
});
|
||||
|
||||
it("renders Rule as a button (card is interactive)", () => {
|
||||
render(<FinalReviewScreen />);
|
||||
const buttons = screen.getAllByRole("button");
|
||||
|
||||
Reference in new issue
Block a user