Skip to content

Commit a79920e

Browse files
committed
fix: error test dates
1 parent bffe051 commit a79920e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/pages/TodoList/TodoItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function TodoItem({ todo }: TodoItemProps) {
1919
</CardHeader>
2020
<CardFooter className="flex justify-between items-center">
2121
<span className="text-sm text-muted-foreground" data-testid={`todo-date-${todo.id}`}>
22-
Date: {new Date(todo.date).toLocaleDateString()}
22+
Date: {todo.date}
2323
</span>
2424
<deleteFetcher.Form method="DELETE" action="/todos">
2525
<input type="hidden" name="id" value={todo.id} />

src/twd-tests/todoList.twd.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe("Todo List Page", () => {
77
twd.clearRequestMockRules();
88
});
99

10-
it.skip("should display the todo list", async () => {
10+
it("should display the todo list", async () => {
1111
await twd.mockRequest("getTodoList", {
1212
method: "GET",
1313
url: "/api/todos",
@@ -27,9 +27,9 @@ describe("Todo List Page", () => {
2727
const todo2Description = await twd.get("[data-testid='todo-description-2']");
2828
todo2Description.should("have.text", "Create a todo list application to demonstrate TWD features");
2929
const todo1Date = await twd.get("[data-testid='todo-date-1']");
30-
todo1Date.should("have.text", "Date: 20/12/2024");
30+
todo1Date.should("have.text", "Date: 2024-12-20");
3131
const todo2Date = await twd.get("[data-testid='todo-date-2']");
32-
todo2Date.should("have.text", "Date: 25/12/2024");
32+
todo2Date.should("have.text", "Date: 2024-12-25");
3333
});
3434

3535
it("should delete a todo", async () => {

0 commit comments

Comments
 (0)