fix: fix URL parameter for task (#20463)

This commit is contained in:
Bruno Quaresma
2025-10-24 11:56:57 -03:00
committed by GitHub
parent f6e86c6fdb
commit cd0a2849d0
2 changed files with 13 additions and 4 deletions
+11 -2
View File
@@ -72,10 +72,11 @@ const meta: Meta<typeof TaskPage> = {
reactRouter: reactRouterParameters({
location: {
pathParams: {
taskId: MockTasks[0].id,
username: MockTask.owner_name,
taskId: MockTask.id,
},
},
routing: { path: "/tasks/:taskId" },
routing: { path: "/tasks/:username/:taskId" },
}),
},
};
@@ -89,6 +90,14 @@ export const LoadingTask: Story = {
() => new Promise(() => {}),
);
},
play: async () => {
await waitFor(() => {
expect(API.experimental.getTask).toHaveBeenCalledWith(
MockTask.owner_name,
MockTask.id,
);
});
},
};
export const LoadingWorkspace: Story = {
+2 -2
View File
@@ -55,8 +55,8 @@ const TaskPageLayout: FC<PropsWithChildren> = ({ children }) => {
};
const TaskPage = () => {
const { task: taskId, username } = useParams() as {
task: string;
const { taskId, username } = useParams() as {
taskId: string;
username: string;
};
const { data: task, ...taskQuery } = useQuery({