12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- import from 'sentry/actionCreators/onboardingTasks';
- import ConfigStore from 'sentry/stores/configStore';
- import OrganizationStore from 'sentry/stores/organizationStore';
- import from 'sentry/types';
- describe('actionCreators/onboardingTasks', function ()
- );
-
- const testTask =
- as const;
- const mockUpdate = MockApiClient.addMockResponse(
- /onboarding-tasks/`,
- method: 'POST',
- body: testTask,
- });
- updateOnboardingTask(api, detailedOrg, testTask);
- await tick();
- expect(mockUpdate).toHaveBeenCalled();
- expect(OrganizationStore.onUpdate).toHaveBeenCalledWith(
- ],
- });
- });
- it('Updates existing onboarding task', async function ()
- ],
- });
- const testTask =
- as const;
- MockApiClient.clearMockResponses();
- const mockUpdate = MockApiClient.addMockResponse(
- /onboarding-tasks/`,
- method: 'POST',
- body: testTask,
- });
- updateOnboardingTask(api, detailedOrg, testTask);
- await tick();
- expect(mockUpdate).toHaveBeenCalled();
-
-
- expect(OrganizationStore.onUpdate).toHaveBeenCalledWith(
- );
- });
- it('Does not make API request without api object', async function ()
- );
- const testTask =
- as const;
- const mockUpdate = MockApiClient.addMockResponse(
- /onboarding-tasks/`,
- method: 'POST',
- });
- updateOnboardingTask(null, detailedOrg, testTask);
- await tick();
- expect(mockUpdate).not.toHaveBeenCalled();
- expect(OrganizationStore.onUpdate).toHaveBeenCalledWith(
- ],
- });
- });
- });
- });
|