mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update stale Chromatic comments (#27714)
This commit is contained in:
@@ -6,8 +6,8 @@ const meta: Meta<typeof LastSeen> = {
|
||||
title: "components/LastSeen",
|
||||
component: LastSeen,
|
||||
args: {
|
||||
// We typically want this component to be excluded from Chromatic's snapshots,
|
||||
// because it creates a lot of noise when a static dates roles over from eg.
|
||||
// We typically want this component to be excluded from snapshot tests,
|
||||
// because it creates a lot of noise when a static date rolls over from eg.
|
||||
// "2 months ago" to "3 months ago", but these stories use relative dates,
|
||||
// and test specific cases that we want to be validated.
|
||||
"data-pixel": "",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* @file Mock input props for use with PaginationContainer's tests and stories.
|
||||
*
|
||||
* Had to split this off into a separate file because housing these in the test
|
||||
* file and then importing them from the stories file was causing Chromatic's
|
||||
* Vite test environment to break
|
||||
* file and then importing them from the stories file was breaking Storybook's
|
||||
* build
|
||||
*/
|
||||
import type { PaginationResult } from "./PaginationContainer";
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export const Blocks: FC<BlocksProps> = ({ count }) => {
|
||||
const [availableWidth, setAvailableWidth] = useState<number>(0);
|
||||
const blocksRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Fix: When using useLayoutEffect, Chromatic fails to calculate the right width.
|
||||
// Fix: When using useLayoutEffect, snapshot tests fail to calculate the right width.
|
||||
useEffect(() => {
|
||||
if (availableWidth || !blocksRef.current) {
|
||||
return;
|
||||
|
||||
@@ -570,8 +570,8 @@ export const WithWorkspaces: Story = {
|
||||
await userEvent.click(
|
||||
body.getByText("Attach workspace").closest("button")!,
|
||||
);
|
||||
// Wait for the workspace combobox dropdown to appear so
|
||||
// Chromatic captures it.
|
||||
// Wait for the workspace combobox dropdown to appear so snapshot tests
|
||||
// capture it.
|
||||
await body.findByPlaceholderText("Search workspaces...");
|
||||
},
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ export const buildStreamRenderState = (
|
||||
/**
|
||||
* Pinned clock for stories that render countdown timers. Stories
|
||||
* should mock `Date.now` to return this value so the countdowns
|
||||
* are deterministic across Chromatic snapshots.
|
||||
* are deterministic across snapshot tests.
|
||||
*
|
||||
* Set to midnight UTC on the same day as the fixture deadlines,
|
||||
* giving reconnect a 1s countdown and retry a 2s countdown.
|
||||
|
||||
@@ -297,7 +297,7 @@ const ChatSearchResultRow: FC<ChatSearchResultRowProps> = ({
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)}
|
||||
{/* Pin the ignored mask width so Chromatic does not diff bounding rect changes. */}
|
||||
{/* Pin the ignored mask width so Pixel does not diff bounding rect changes. */}
|
||||
<span data-pixel="ignore" className="inline-block w-7 text-right">
|
||||
{shortRelativeTime(chat.updated_at)}
|
||||
</span>
|
||||
|
||||
@@ -294,7 +294,7 @@ export const ChatTreeNode: FC<ChatTreeNodeProps> = ({ chat, isChildNode }) => {
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
{/* Pin the ignored mask width so Chromatic does not diff bounding rect changes. */}
|
||||
{/* Pin the ignored mask width so Pixel does not diff bounding rect changes. */}
|
||||
<span
|
||||
data-pixel="ignore"
|
||||
className="inline-block w-7 text-right"
|
||||
|
||||
@@ -27,8 +27,7 @@ const validationSchema = yup.object({
|
||||
});
|
||||
|
||||
type ChangePasswordChangeProps = {
|
||||
// This is used to prevent redirection when testing the page in Storybook and
|
||||
// capturing Chromatic snapshots.
|
||||
// This is used to prevent redirection in Storybook.
|
||||
redirect?: boolean;
|
||||
};
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ const TaskRow: FC<TaskRowProps> = ({ task, checked, onCheckChange }) => {
|
||||
});
|
||||
|
||||
const taskPageLink = `/tasks/${task.owner_name}/${task.id}`;
|
||||
// Discard role, breaks Chromatic.
|
||||
// Discard role, breaks snapshot tests.
|
||||
const { role, ...clickableRowProps } = useClickableTableRow({
|
||||
onClick: () => {
|
||||
navigate(taskPageLink);
|
||||
|
||||
Reference in New Issue
Block a user