Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests for when float is off #25839

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export function setCurrentlyRenderingBoundaryResourcesTarget(
resources.boundaryResources = boundaryResources;
}

export const ReactDOMServerDispatcher = {
export const ReactDOMServerFloatDispatcher = {
preload,
preinit,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import {
resourcesFromElement,
resourcesFromLink,
resourcesFromScript,
ReactDOMServerDispatcher,
ReactDOMServerFloatDispatcher,
} from './ReactDOMFloatServer';
export {
createResources,
Expand All @@ -89,6 +89,10 @@ import {
import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals';
const ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;

const ReactDOMServerDispatcher = enableFloat
? ReactDOMServerFloatDispatcher
: {};

export function prepareToRender(resources: Resources): mixed {
prepareToRenderResources(resources);

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMFloat-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ describe('ReactDOMFloat', () => {
]);
});

// @gate enableFloat
it('dedupes if the external runtime is explicitly loaded using preinit', async () => {
const unstable_externalRuntimeSrc = 'src-of-external-runtime';
function App() {
Expand Down Expand Up @@ -5681,7 +5682,6 @@ describe('ReactDOMFloat', () => {
);
});

// @gate enableFloat
it('should not treat title descendants of svg into resources', async () => {
await actIntoEmptyDocument(() => {
const {pipe} = renderToPipeableStream(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('ReactDOM HostSingleton', () => {
: children;
}

// @gate enableHostSingletons
// @gate enableHostSingletons && enableFloat
it('warns if you render the same singleton twice at the same time', async () => {
const root = ReactDOMClient.createRoot(document);
root.render(
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('ReactDOM HostSingleton', () => {
);
});

// @gate enableHostSingletons
// @gate enableHostSingletons && enableFloat
it('renders into html, head, and body persistently so the node identities never change and extraneous styles are retained', async () => {
gate(flags => {
if (flags.enableHostSingletons !== true) {
Expand Down