Skip to content

Commit

Permalink
Merge branch 'next' of github.com:storybookjs/storybook into jeppe/re…
Browse files Browse the repository at this point in the history
…act-prerelease-sandboxes
  • Loading branch information
JReinhold committed Apr 26, 2024
2 parents 9f7ca74 + 34f0c20 commit 5731002
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/e2e-tests/addon-docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('addon-docs', () => {
await new Promise(resolve => resolve('Play function'));
}
}`;
await expect(sourceCode.textContent()).resolves.toContain(expectedSource);
await expect(sourceCode).toHaveText(expectedSource);
});

test('should render errors', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion code/e2e-tests/framework-svelte.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test.describe('Svelte', () => {
await showCodeButton.click();
const sourceCode = root.locator('pre.prismjs');
const expectedSource = '<ButtonJavaScript primary/>';
await expect(sourceCode.textContent()).resolves.toContain(expectedSource);
await expect(sourceCode).toHaveText(expectedSource);
});

test('Decorators runs only once', async ({ page }) => {
Expand Down
8 changes: 4 additions & 4 deletions code/lib/react-dom-shim/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { readFile } from 'fs/promises';
* Get react-dom version from the resolvedReact preset, which points to either
* a root react-dom dependency or the react-dom dependency shipped with addon-docs
*/
const getIsReactVersion18 = async (options: Options) => {
const getIsReactVersion18or19 = async (options: Options) => {
const { legacyRootApi } =
(await options.presets.apply<{ legacyRootApi?: boolean } | null>('frameworkOptions')) || {};

Expand All @@ -24,11 +24,11 @@ const getIsReactVersion18 = async (options: Options) => {
}

const { version } = JSON.parse(await readFile(join(reactDom, 'package.json'), 'utf-8'));
return version.startsWith('18') || version.startsWith('0.0.0');
return version.startsWith('18') || version.startsWith('19') || version.startsWith('0.0.0');
};

export const webpackFinal = async (config: any, options: Options) => {
const isReactVersion18 = await getIsReactVersion18(options);
const isReactVersion18 = await getIsReactVersion18or19(options);
if (isReactVersion18) {
return config;
}
Expand All @@ -46,7 +46,7 @@ export const webpackFinal = async (config: any, options: Options) => {
};

export const viteFinal = async (config: any, options: Options) => {
const isReactVersion18 = await getIsReactVersion18(options);
const isReactVersion18 = await getIsReactVersion18or19(options);
if (isReactVersion18) {
return config;
}
Expand Down

0 comments on commit 5731002

Please sign in to comment.