123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- import from 'sentry/actionCreators/onboardingTasks';
- import ConfigStore from 'sentry/stores/configStore';
- import OrganizationStore from 'sentry/stores/organizationStore';
- describe('actionCreators/onboardingTasks', function ()
- );
-
- const testTask =
- ;
- 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 =
- ;
- 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 =
- ;
- const mockUpdate = MockApiClient.addMockResponse(
- /onboarding-tasks/`,
- method: 'POST',
- });
- updateOnboardingTask(null, detailedOrg, testTask);
- await tick();
- expect(mockUpdate).not.toHaveBeenCalled();
- expect(OrganizationStore.onUpdate).toHaveBeenCalledWith(
- ],
- });
- });
- });
- });
|