From fe21ee7ca0f143d05b09ac43914db0d744380e08 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 16 Apr 2019 16:47:14 +0100 Subject: [PATCH] Enable part of Suspense test that was failing before This PR fixes it. --- src/__tests__/store-test.js | 83 +++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/src/__tests__/store-test.js b/src/__tests__/store-test.js index 54b5761f29..a457dd57e3 100644 --- a/src/__tests__/store-test.js +++ b/src/__tests__/store-test.js @@ -555,45 +555,48 @@ describe('Store', () => { } } - // TODO: fix the bugs - // // 4. Verify we can update from each step to each step in fallback mode. - // for (let i = 0; i < steps.length; i++) { - // for (let j = 0; j < steps.length; j++) { - // // Always start with a fresh container and steps[i]. - // container = document.createElement('div'); - // act(() => ReactDOM.render( - // - // - // - // - // - // - // - // - // , - // container - // )); - // expect(print(store)).toEqual(snapshots[i]); - // // Re-render with steps[j]. - // act(() => ReactDOM.render( - // - // - // - // - // - // - // - // - // , - // container - // )); - // // Verify the successful transition to steps[j]. - // expect(print(store)).toEqual(snapshots[j]); - // // Clean up after every iteration. - // act(() => ReactDOM.unmountComponentAtNode(container)); - // expect(print(store)).toBe(''); - // } - // } + // 4. Verify we can update from each step to each step in fallback mode. + for (let i = 0; i < steps.length; i++) { + for (let j = 0; j < steps.length; j++) { + // Always start with a fresh container and steps[i]. + container = document.createElement('div'); + act(() => + ReactDOM.render( + + + + + + + + + , + container + ) + ); + expect(print(store)).toEqual(snapshots[i]); + // Re-render with steps[j]. + act(() => + ReactDOM.render( + + + + + + + + + , + container + ) + ); + // Verify the successful transition to steps[j]. + expect(print(store)).toEqual(snapshots[j]); + // Clean up after every iteration. + act(() => ReactDOM.unmountComponentAtNode(container)); + expect(print(store)).toBe(''); + } + } // 5. Verify we can update from each step to each step when moving primary -> fallback. for (let i = 0; i < steps.length; i++) { @@ -776,4 +779,4 @@ describe('Store', () => { // TODO: // Test Concurrent Mode }); -}); \ No newline at end of file +});