Skip to content

Commit e135618

Browse files
[FSSDK-10544] test comments cleanup
1 parent f87cbf4 commit e135618

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/hooks.spec.tsx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ describe('hooks', () => {
7171
let notificationListenerCallbacks: Array<() => void>;
7272
let optimizelyMock: ReactSDKClient;
7373
let readySuccess: boolean;
74-
// let reason: NotReadyReason;
7574
let userUpdateCallbacks: Array<() => void>;
7675
let UseExperimentLoggingComponent: React.FunctionComponent<any>;
7776
let UseFeatureLoggingComponent: React.FunctionComponent<any>;
@@ -214,7 +213,7 @@ describe('hooks', () => {
214213

215214
it('should respect the timeout option passed', async () => {
216215
activateMock.mockReturnValue(null);
217-
mockDelay = 100;
216+
mockDelay = 20;
218217
readySuccess = false;
219218

220219
render(
@@ -255,8 +254,6 @@ describe('hooks', () => {
255254
</OptimizelyProvider>
256255
);
257256

258-
// TODO - Wrap this with async act() once we upgrade to React 16.9
259-
// See https://github.com/facebook/react/issues/15379
260257
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('null|true|false'));
261258

262259
activateMock.mockReturnValue('12345');
@@ -276,8 +273,6 @@ describe('hooks', () => {
276273
</OptimizelyProvider>
277274
);
278275

279-
// // TODO - Wrap this with async act() once we upgrade to React 16.9
280-
// // See https://github.com/facebook/react/issues/15379
281276
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('null|true|false'));
282277

283278
activateMock.mockReturnValue('12345');
@@ -455,7 +450,7 @@ describe('hooks', () => {
455450
});
456451

457452
it('should respect the timeout option passed', async () => {
458-
mockDelay = 100;
453+
mockDelay = 20;
459454
isFeatureEnabledMock.mockReturnValue(false);
460455
featureVariables = {};
461456
readySuccess = false;
@@ -502,8 +497,6 @@ describe('hooks', () => {
502497
</OptimizelyProvider>
503498
);
504499

505-
// TODO - Wrap this with async act() once we upgrade to React 16.9
506-
// See https://github.com/facebook/react/issues/15379
507500
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('false|{}|true|false'));
508501

509502
isFeatureEnabledMock.mockReturnValue(true);
@@ -525,8 +518,6 @@ describe('hooks', () => {
525518
</OptimizelyProvider>
526519
);
527520

528-
// TODO - Wrap this with async act() once we upgrade to React 16.9
529-
// See https://github.com/facebook/react/issues/15379
530521
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('false|{}|true|false'));
531522

532523
isFeatureEnabledMock.mockReturnValue(true);
@@ -535,7 +526,7 @@ describe('hooks', () => {
535526
act(() => {
536527
userUpdateCallbacks.forEach((fn) => fn());
537528
});
538-
// component.update();
529+
539530
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('false|{}|true|false'));
540531
});
541532

@@ -697,7 +688,7 @@ describe('hooks', () => {
697688
it('should respect the timeout option passed', async () => {
698689
decideMock.mockReturnValue({ ...defaultDecision });
699690
readySuccess = false;
700-
mockDelay = 100;
691+
mockDelay = 20;
701692

702693
render(
703694
<OptimizelyProvider optimizely={optimizelyMock}>
@@ -741,8 +732,6 @@ describe('hooks', () => {
741732
</OptimizelyProvider>
742733
);
743734

744-
// TODO - Wrap this with async act() once we upgrade to React 16.9
745-
// See https://github.com/facebook/react/issues/15379
746735
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('false|{}|true|false'));
747736

748737
decideMock.mockReturnValue({
@@ -765,8 +754,6 @@ describe('hooks', () => {
765754
</OptimizelyProvider>
766755
);
767756

768-
// TODO - Wrap this with async act() once we upgrade to React 16.9
769-
// See https://github.com/facebook/react/issues/15379
770757
await waitFor(() => expect(screen.getByTestId('result')).toHaveTextContent('false|{}|true|false'));
771758

772759
decideMock.mockReturnValue({
@@ -789,7 +776,7 @@ describe('hooks', () => {
789776
<UseDecisionLoggingComponent />
790777
</OptimizelyProvider>
791778
);
792-
// component.update();
779+
793780
expect(mockLog).toHaveBeenCalledTimes(1);
794781
expect(mockLog).toHaveBeenCalledWith(false);
795782
});

0 commit comments

Comments
 (0)