@cratis/arc.react 18.5.0 → 18.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/for_CommandScopeImplementation/FakeCommand.ts +25 -26
- package/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.ts +2 -2
- package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
- package/dist/cjs/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts +17 -0
- package/dist/cjs/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/cjs/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
- package/dist/cjs/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
- package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
- package/dist/cjs/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
- package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
- package/dist/cjs/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts +14 -0
- package/dist/cjs/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/cjs/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
- package/dist/cjs/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts +23 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js +49 -0
- package/dist/esm/commands/for_CommandScopeImplementation/FakeCommand.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js +17 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_executing_with_three_commands_were_two_having_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js +13 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_none_of_the_added_commands_has_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js +13 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_one_of_the_added_commands_has_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js +18 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_property_changes_on_added_command.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js +17 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_reverting_with_three_commands_were_two_having_changes.js.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts +2 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.d.ts.map +1 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js +6 -0
- package/dist/esm/commands/for_CommandScopeImplementation/when_there_are_no_commands.js.map +1 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.d.ts +17 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.js +18 -0
- package/dist/esm/commands/for_useCommand/FakeCommand.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.js +28 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js +24 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_with_initial_values.js.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js +24 -0
- package/dist/esm/commands/for_useCommand/when_creating_instance_without_optional_context_values.js.map +1 -0
- package/dist/esm/for_Bindings/given/bindings_context.d.ts +4 -0
- package/dist/esm/for_Bindings/given/bindings_context.d.ts.map +1 -0
- package/dist/esm/for_Bindings/given/bindings_context.js +5 -0
- package/dist/esm/for_Bindings/given/bindings_context.js.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.d.ts +2 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.d.ts.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.js +24 -0
- package/dist/esm/for_Bindings/when_initializing_bindings.js.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts +2 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.d.ts.map +1 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js +24 -0
- package/dist/esm/for_Bindings/when_initializing_bindings_without_optional_parameters.js.map +1 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts +2 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.d.ts.map +1 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js +47 -0
- package/dist/esm/identity/for_IdentityProvider/when_refreshing_identity.js.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts +19 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.d.ts.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js +25 -0
- package/dist/esm/queries/for_useObservableQuery/FakeObservableQuery.js.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts +2 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js +66 -0
- package/dist/esm/queries/for_useObservableQuery/when_creating_instance.js.map +1 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.d.ts +14 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.js +13 -0
- package/dist/esm/queries/for_useQuery/FakeQuery.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.js +48 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js +40 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_with_sorting.js.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts +2 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.d.ts.map +1 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js +44 -0
- package/dist/esm/queries/for_useQuery/when_creating_instance_without_optional_context_values.js.map +1 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts +2 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.d.ts.map +1 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js +51 -0
- package/dist/esm/queries/for_useQueryWithPaging/when_creating_instance_with_paging.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/global.d.ts +11 -0
- package/identity/for_IdentityProvider/when_refreshing_identity.ts +4 -3
- package/package.json +2 -2
- package/queries/for_useObservableQuery/when_creating_instance.ts +2 -2
- package/queries/for_useQuery/when_creating_instance.ts +6 -2
- package/queries/for_useQuery/when_creating_instance_with_sorting.ts +6 -4
- package/queries/for_useQuery/when_creating_instance_without_optional_context_values.ts +6 -2
- package/queries/for_useQueryWithPaging/when_creating_instance_with_paging.ts +6 -2
|
@@ -6,7 +6,7 @@ import { render } from '@testing-library/react';
|
|
|
6
6
|
import { IdentityProvider } from '../IdentityProvider';
|
|
7
7
|
import { useIdentity } from '../useIdentity';
|
|
8
8
|
import { IIdentity } from '@cratis/arc/identity';
|
|
9
|
-
import
|
|
9
|
+
import { createFetchHelper } from '@cratis/arc/helpers/fetchHelper';
|
|
10
10
|
|
|
11
11
|
describe('when refreshing identity', async () => {
|
|
12
12
|
let capturedIdentity: IIdentity | null = null;
|
|
@@ -22,7 +22,8 @@ describe('when refreshing identity', async () => {
|
|
|
22
22
|
return React.createElement('div', null, 'Test');
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const fetchHelper = createFetchHelper();
|
|
26
|
+
const mockFetch = fetchHelper.stubFetch();
|
|
26
27
|
mockFetch.onFirstCall().resolves({
|
|
27
28
|
json: async () => ({
|
|
28
29
|
id: 'initial-id',
|
|
@@ -55,5 +56,5 @@ describe('when refreshing identity', async () => {
|
|
|
55
56
|
it('should have new id', () => newId.should.equal('new-id'));
|
|
56
57
|
it('should have new name', () => newName.should.equal('Updated User'));
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
fetchHelper.restore();
|
|
59
60
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/arc.react",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Cratis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"up": "yarn g:up"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cratis/arc": "18.
|
|
62
|
+
"@cratis/arc": "18.6.0",
|
|
63
63
|
"tsyringe": "^4.10.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
@@ -78,7 +78,7 @@ describe('when creating instance', () => {
|
|
|
78
78
|
callback!.should.not.be.undefined;
|
|
79
79
|
|
|
80
80
|
await act(async () => {
|
|
81
|
-
callback({
|
|
81
|
+
callback(new QueryResult({
|
|
82
82
|
data: [{ id: '1', name: 'Test' }],
|
|
83
83
|
isSuccess: true,
|
|
84
84
|
isAuthorized: true,
|
|
@@ -88,7 +88,7 @@ describe('when creating instance', () => {
|
|
|
88
88
|
exceptionMessages: [],
|
|
89
89
|
exceptionStackTrace: '',
|
|
90
90
|
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 }
|
|
91
|
-
}
|
|
91
|
+
}, Array, true));
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
capturedIsPerformingInitial!.should.be.true;
|
|
@@ -7,11 +7,13 @@ import sinon from 'sinon';
|
|
|
7
7
|
import { useQuery } from '../useQuery';
|
|
8
8
|
import { FakeQuery } from './FakeQuery';
|
|
9
9
|
import { ArcContext, ArcConfiguration } from '../../ArcContext';
|
|
10
|
+
import { createFetchHelper } from '@cratis/arc/helpers/fetchHelper';
|
|
10
11
|
|
|
11
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
13
|
|
|
13
14
|
describe('when creating instance', () => {
|
|
14
15
|
let fetchStub: sinon.SinonStub;
|
|
16
|
+
let fetchHelper: { stubFetch: () => sinon.SinonStub; restore: () => void };
|
|
15
17
|
let queryInstance: FakeQuery | null = null;
|
|
16
18
|
|
|
17
19
|
const captureInstance = (instance: FakeQuery) => {
|
|
@@ -19,13 +21,15 @@ describe('when creating instance', () => {
|
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
beforeEach(() => {
|
|
22
|
-
|
|
24
|
+
fetchHelper = createFetchHelper();
|
|
25
|
+
fetchStub = fetchHelper.stubFetch();
|
|
26
|
+
fetchStub.resolves({
|
|
23
27
|
json: async () => ({ data: [], isSuccess: true, isAuthorized: true, isValid: true, hasExceptions: false, validationResults: [], exceptionMessages: [], exceptionStackTrace: '' })
|
|
24
28
|
} as Response);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
afterEach(() => {
|
|
28
|
-
|
|
32
|
+
fetchHelper.restore();
|
|
29
33
|
});
|
|
30
34
|
|
|
31
35
|
const config: ArcConfiguration = {
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { render } from '@testing-library/react';
|
|
6
|
-
import sinon from 'sinon';
|
|
7
6
|
import { useQuery } from '../useQuery';
|
|
8
7
|
import { FakeQuery } from './FakeQuery';
|
|
9
8
|
import { ArcContext, ArcConfiguration } from '../../ArcContext';
|
|
10
9
|
import { Sorting } from '@cratis/arc/queries';
|
|
10
|
+
import { createFetchHelper } from '@cratis/arc/helpers/fetchHelper';
|
|
11
11
|
|
|
12
12
|
describe('when creating instance with sorting', () => {
|
|
13
|
-
let
|
|
13
|
+
let fetchHelper: { stubFetch: () => sinon.SinonStub; restore: () => void };
|
|
14
14
|
let queryInstance: FakeQuery | null = null;
|
|
15
15
|
|
|
16
16
|
const captureInstance = (instance: FakeQuery) => {
|
|
@@ -18,13 +18,15 @@ describe('when creating instance with sorting', () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
beforeEach(() => {
|
|
21
|
-
|
|
21
|
+
fetchHelper = createFetchHelper();
|
|
22
|
+
const fetchStub = fetchHelper.stubFetch();
|
|
23
|
+
fetchStub.resolves({
|
|
22
24
|
json: async () => ({ data: [], isSuccess: true, isAuthorized: true, isValid: true, hasExceptions: false, validationResults: [], exceptionMessages: [], exceptionStackTrace: '' })
|
|
23
25
|
} as Response);
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
afterEach(() => {
|
|
27
|
-
|
|
29
|
+
fetchHelper.restore();
|
|
28
30
|
});
|
|
29
31
|
|
|
30
32
|
const config: ArcConfiguration = {
|
|
@@ -7,11 +7,13 @@ import sinon from 'sinon';
|
|
|
7
7
|
import { useQuery } from '../useQuery';
|
|
8
8
|
import { FakeQuery } from './FakeQuery';
|
|
9
9
|
import { ArcContext, ArcConfiguration } from '../../ArcContext';
|
|
10
|
+
import { createFetchHelper } from '@cratis/arc/helpers/fetchHelper';
|
|
10
11
|
|
|
11
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
12
13
|
|
|
13
14
|
describe('when creating instance without optional context values', () => {
|
|
14
15
|
let fetchStub: sinon.SinonStub;
|
|
16
|
+
let fetchHelper: { stubFetch: () => sinon.SinonStub; restore: () => void };
|
|
15
17
|
let queryInstance: FakeQuery | null = null;
|
|
16
18
|
|
|
17
19
|
const captureInstance = (instance: FakeQuery) => {
|
|
@@ -19,13 +21,15 @@ describe('when creating instance without optional context values', () => {
|
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
beforeEach(() => {
|
|
22
|
-
|
|
24
|
+
fetchHelper = createFetchHelper();
|
|
25
|
+
fetchStub = fetchHelper.stubFetch();
|
|
26
|
+
fetchStub.resolves({
|
|
23
27
|
json: async () => ({ data: [], isSuccess: true, isAuthorized: true, isValid: true, hasExceptions: false, validationResults: [], exceptionMessages: [], exceptionStackTrace: '' })
|
|
24
28
|
} as Response);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
afterEach(() => {
|
|
28
|
-
|
|
32
|
+
fetchHelper.restore();
|
|
29
33
|
});
|
|
30
34
|
|
|
31
35
|
const config: ArcConfiguration = {
|
|
@@ -8,11 +8,13 @@ import { useQueryWithPaging } from '../useQuery';
|
|
|
8
8
|
import { FakeQuery } from '../for_useQuery/FakeQuery';
|
|
9
9
|
import { ArcContext, ArcConfiguration } from '../../ArcContext';
|
|
10
10
|
import { Paging } from '@cratis/arc/queries';
|
|
11
|
+
import { createFetchHelper } from '@cratis/arc/helpers/fetchHelper';
|
|
11
12
|
|
|
12
13
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
14
|
|
|
14
15
|
describe('when creating instance with paging', () => {
|
|
15
16
|
let fetchStub: sinon.SinonStub;
|
|
17
|
+
let fetchHelper: { stubFetch: () => sinon.SinonStub; restore: () => void };
|
|
16
18
|
let queryInstance: FakeQuery | null = null;
|
|
17
19
|
|
|
18
20
|
const captureInstance = (instance: FakeQuery) => {
|
|
@@ -20,13 +22,15 @@ describe('when creating instance with paging', () => {
|
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
beforeEach(() => {
|
|
23
|
-
|
|
25
|
+
fetchHelper = createFetchHelper();
|
|
26
|
+
fetchStub = fetchHelper.stubFetch();
|
|
27
|
+
fetchStub.resolves({
|
|
24
28
|
json: async () => ({ data: [], isSuccess: true, isAuthorized: true, isValid: true, hasExceptions: false, validationResults: [], exceptionMessages: [], exceptionStackTrace: '' })
|
|
25
29
|
} as Response);
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
afterEach(() => {
|
|
29
|
-
|
|
33
|
+
fetchHelper.restore();
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
const config: ArcConfiguration = {
|