Skip to content

Test broken: PostListClient.test.tsx asserts old /posts/[id]/edit href #519

Description

@tayebmokni

Summary

The recent session changed `postEditHref` in `apps/admin/src/app/(authenticated)/posts/columns.tsx` from `/posts/${id}/edit` to `/posts/${id}` (the actual route). The corresponding test was not updated.

`apps/admin/src/app/(authenticated)/posts/PostListClient.test.tsx` (lines 96-102) still asserts:

```tsx
expect(row).toHaveAttribute('href', '/posts/p1/edit');
```

…which now fails. Test suite is red.

Fix

Update the assertion to `/posts/p1`. While there: add a regression assertion that the comments table doesn't still link to `/posts/[id]/edit` (related to #503).

Reproduce

```
cd apps/admin && pnpm test PostListClient
```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions