it('should handle the API error for `togglePublishChallengeState` method', async(() => {
    const expectedApiError = {
      error: 'Api error',
    };
    spyOn(apiService, 'patchUrl').and.returnValue(