-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0e0df9
commit a3071f1
Showing
14 changed files
with
352 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.15.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
if (typeof (Promise as any).withResolvers === "undefined") { | ||
(Promise as any).withResolvers = <T>(): { | ||
promise: Promise<T>; | ||
resolve: (value: T | PromiseLike<T>) => void; | ||
// biome-ignore lint/suspicious/noExplicitAny: any is needed for the reject function | ||
reject: (reason?: any) => void; | ||
} => { | ||
let resolve: (value: T | PromiseLike<T>) => void; | ||
let reject: (reason?: unknown) => void; | ||
|
||
const promise = new Promise<T>((res, rej) => { | ||
resolve = res; | ||
reject = rej; | ||
}); | ||
|
||
// @ts-ignore | ||
return { promise, resolve, reject }; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
export * from '../.storybook/preview' | ||
import '../app/style.css' | ||
import type { Preview } from '@storybook/react' | ||
import { initialize, mswLoader } from 'msw-storybook-addon' | ||
import * as MockDate from 'mockdate' | ||
import { initializeDB } from '#lib/db.mock' | ||
|
||
initialize({ onUnhandledRequest: 'bypass', quiet: false }) | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
test: { | ||
// This is needed until Next will update to the React 19 beta: https://github.com/vercel/next.js/pull/65058 | ||
// In the React 19 beta ErrorBoundary errors (such as redirect) are only logged, and not thrown. | ||
dangerouslyIgnoreUnhandledErrors: true, | ||
}, | ||
nextjs: { appDirectory: true }, | ||
}, | ||
loaders: [() => { | ||
}, mswLoader, () => { | ||
}], | ||
beforeEach() { | ||
// Fixed dates for consistent screenshots | ||
MockDate.set('2024-04-18T12:24:02Z') | ||
// reset the database to avoid hanging state between stories | ||
initializeDB() | ||
}, | ||
} | ||
|
||
export default preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.