Skip to content

Commit

Permalink
Remove TODO_17 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
createthis authored and eps1lon committed Aug 2, 2022
1 parent 1337f75 commit 07504db
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 26 deletions.
14 changes: 6 additions & 8 deletions packages/enzyme-test-suite/test/ReactWrapper-spec.jsx
Expand Up @@ -42,7 +42,6 @@ import describeLifecycles from './_helpers/describeLifecycles';
import describeHooks from './_helpers/describeHooks';
import {
is,
TODO_17,
} from './_helpers/version';

describeWithDOM('mount', () => {
Expand Down Expand Up @@ -1150,7 +1149,7 @@ describeWithDOM('mount', () => {
}
}

itIf(!TODO_17(true), 'finds Suspense and its children when no lazy component', () => {
it('finds Suspense and its children when no lazy component', () => {
class Component extends React.Component {
render() {
return (
Expand All @@ -1172,7 +1171,7 @@ describeWithDOM('mount', () => {
expect(wrapper.find(Fallback)).to.have.lengthOf(0);
});

itIf(!TODO_17(true), 'works with Suspense with multiple children', () => {
it('works with Suspense with multiple children', () => {
const SuspenseComponent = () => (
<Suspense fallback={<Fallback />}>
<div />
Expand Down Expand Up @@ -1233,8 +1232,7 @@ describeWithDOM('mount', () => {

expect(wrapper.debug()).to.equal(`<SuspenseComponent>
<Suspense fallback={{...}}>
${TODO_17(true) ? `<Suspense mode="visible" />
` : ''}<Fallback>
<Fallback>
<div>
Fallback
</div>
Expand All @@ -1243,7 +1241,7 @@ describeWithDOM('mount', () => {
</SuspenseComponent>`);
});

itIf(!TODO_17(true), 'return wrapped component when given loaded lazy component in initial mount', () => {
it('return wrapped component when given loaded lazy component in initial mount', () => {
const LazyComponent = getLoadedLazyComponent(DynamicComponent);
const SuspenseComponent = () => (
<Suspense fallback={<Fallback />}>
Expand Down Expand Up @@ -1271,11 +1269,11 @@ describeWithDOM('mount', () => {

expect(wrapper.debug()).to.equal(`<SuspenseComponent>
<Suspense fallback={{...}}>
${TODO_17(true) ? '<Suspense mode="visible" />' : `<DynamicComponent>
<DynamicComponent>
<div>
Dynamic Component
</div>
</DynamicComponent>`}
</DynamicComponent>
</Suspense>
</SuspenseComponent>`);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/enzyme-test-suite/test/Utils-spec.jsx
Expand Up @@ -30,7 +30,7 @@ import { get, reset, merge as configure } from 'enzyme/build/configuration';
import './_helpers/setupAdapters';

import { describeIf } from './_helpers';
import { is, TODO_17 } from './_helpers/version';
import { is } from './_helpers/version';

describe('Utils', () => {
describe('nodeEqual', () => {
Expand Down Expand Up @@ -593,7 +593,7 @@ describe('Utils', () => {
});
});

describeIf(is('>= 16.6') && !TODO_17(true), 'given an inner displayName wrapped in Memo and forwardRef', () => {
describeIf(is('>= 16.6'), 'given an inner displayName wrapped in Memo and forwardRef', () => {
it('returns the displayName', () => {
const adapter = getAdapter();
const Foo = () => <div />;
Expand Down
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import sinon from 'sinon-sandbox';
import { expect } from 'chai';

import { is, TODO_17 } from '../../_helpers/version';
import { is } from '../../_helpers/version';
import {
describeIf,
itIf,
Expand Down Expand Up @@ -206,7 +206,7 @@ export default function describeCDC({
expect(wrapper.find({ children: 'HasNotThrown' })).to.have.lengthOf(0);
});

itIf(!TODO_17(!isShallow), 'catches errors during render', () => {
it('catches errors during render', () => {
const spy = sinon.spy();
const wrapper = Wrap(<ErrorBoundary spy={spy} />);

Expand All @@ -230,7 +230,7 @@ export default function describeCDC({
});
});

itIf(!TODO_17(!isShallow), 'works when the root is an SFC', () => {
it('works when the root is an SFC', () => {
const spy = sinon.spy();
const wrapper = Wrap(<ErrorSFC spy={spy} />);

Expand Down
3 changes: 1 addition & 2 deletions packages/enzyme-test-suite/test/shared/lifecycles/misc.jsx
Expand Up @@ -15,7 +15,6 @@ import {
import {
is,
BATCHING,
TODO_17,
} from '../../_helpers/version';

export default function describeMisc({
Expand Down Expand Up @@ -469,7 +468,7 @@ export default function describeMisc({
]);
});

itIf(!isShallow && !TODO_17(true), 'calls getDerivedStateFromError first and then componentDidCatch', () => {
itIf(!isShallow, 'calls getDerivedStateFromError first and then componentDidCatch', () => {
const wrapper = Wrap(<ErrorBoundary />);

expect(lifecycleSpy.args).to.deep.equal([
Expand Down
10 changes: 4 additions & 6 deletions packages/enzyme-test-suite/test/shared/methods/setContext.jsx
Expand Up @@ -7,7 +7,7 @@ import {
describeIf,
itIf,
} from '../../_helpers';
import { is, TODO_17 } from '../../_helpers/version';
import { is } from '../../_helpers/version';

import {
createClass,
Expand Down Expand Up @@ -112,7 +112,7 @@ export default function describeSetContext({

expect(spy.args).to.deep.equal([
['render'],
...(TODO_17(isShallow) ? [] : [['componentWillReceiveProps']]),
['componentWillReceiveProps'],
['render'],
]);
expect(wrapper.context('foo')).to.equal(updatedProps.foo);
Expand Down Expand Up @@ -161,10 +161,8 @@ export default function describeSetContext({

expect(spy.args).to.deep.equal([
['render'],
...(TODO_17(isShallow) ? [] : [
['componentWillReceiveProps'],
['UNSAFE_componentWillReceiveProps'],
]),
['componentWillReceiveProps'],
['UNSAFE_componentWillReceiveProps'],
['render'],
]);
expect(wrapper.context('foo')).to.equal(updatedProps.foo);
Expand Down
7 changes: 2 additions & 5 deletions packages/enzyme-test-suite/test/shared/methods/simulate.jsx
Expand Up @@ -251,11 +251,8 @@ export default function describeSimulate({
const wrapper = Wrap(<Multistate />);
wrapper.simulate('click');

// TODO: figure out why this is broken in shallow rendering in react 17
const todoShallow17 = isShallow && is('>= 17');

expect(wrapper.text()).to.equal(todoShallow17 ? '2' : '1');
expect(renderCount).to.equal(todoShallow17 ? 3 : 2);
expect(wrapper.text()).to.equal('1');
expect(renderCount).to.equal(2);
});

// FIXME: figure out why this fails on 15.0 and 15.1
Expand Down

0 comments on commit 07504db

Please sign in to comment.