Skip to content

Commit a1de92d

Browse files
committed
Address PR review feedback
- Remove nanoid mock: Vitest handles ESM natively, no mock needed - Use shared generateKey helper in TicketPageContentEditor - Remove nanoid alias from vitest.config.ts
1 parent 1ff2651 commit a1de92d

3 files changed

Lines changed: 1 addition & 20 deletions

File tree

__tests__/mocks/nanoid.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/components/admin/TicketPageContentEditor.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
TicketFaq,
1818
ConferenceVanityMetric,
1919
} from '@/lib/conference/types'
20-
import { nanoid } from 'nanoid'
20+
import { generateKey } from '@/lib/sanity/helpers'
2121

2222
const ICON_OPTIONS = [
2323
{ value: 'MicrophoneIcon', label: 'Microphone' },
@@ -42,10 +42,6 @@ const ICON_OPTIONS = [
4242
{ value: 'CheckBadgeIcon', label: 'Check Badge' },
4343
]
4444

45-
function generateKey(): string {
46-
return nanoid()
47-
}
48-
4945
interface TicketPageContentEditorProps {
5046
conferenceId: string
5147
conferenceTitle: string

vitest.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export default defineConfig({
3838
find: /^uuid$/,
3939
replacement: path.resolve(__dirname, '__tests__/mocks/uuid.ts'),
4040
},
41-
{
42-
find: /^nanoid$/,
43-
replacement: path.resolve(__dirname, '__tests__/mocks/nanoid.ts'),
44-
},
4541
],
4642
},
4743
test: {

0 commit comments

Comments
 (0)