Skip to content

Commit

Permalink
fix: solve next cache module not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
gahyuun committed Apr 4, 2024
1 parent cb574ca commit b5b9f1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config: StorybookConfig = {
...config.resolve.alias,
'@': path.resolve(__dirname, '../'),
'next/headers': path.resolve(__dirname, '../app/utils/test/__mock__/next/headers.ts'),
'next/cache': path.resolve(__dirname, '../app/utils/test/__mock__/next/cache.ts'),
};
}
return config;
Expand Down
10 changes: 2 additions & 8 deletions app/ui/view/molecule/table/table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import Button from '../../atom/button/button';
import { Table } from '.';
import { SwipeAction, TrailingActions } from 'react-swipeable-list';
import DeleteTakenLectureButton from '@/app/ui/lecture/taken-lecture/delete-taken-lecture-button';

const meta = {
title: 'ui/view/molecule/Table',
Expand Down Expand Up @@ -87,13 +87,7 @@ export const SwipeableLectureTable: StoryObj = {
credit: 3,
},
];
const actionButton = () => (
<TrailingActions>
<SwipeAction data-testid="swipe-taken-lecture-delete-button" destructive={true} onClick={() => {}}>
<div className="bg-gray-400 text-white flex justify-center items-center w-14">삭제</div>
</SwipeAction>
</TrailingActions>
);
const actionButton = () => <DeleteTakenLectureButton lectureId={3} swipeable={true} />;
return (
<main>
<Table headerInfo={headerInfo} data={lectures} renderActionButton={actionButton} swipeable={true} />
Expand Down
1 change: 1 addition & 0 deletions app/utils/test/__mock__/next/cache.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function revalidateTag(tag: string) {}

0 comments on commit b5b9f1e

Please sign in to comment.