Skip to content

Commit 9d2eeca

Browse files
Update type for initial state of component id
1 parent 364ac4c commit 9d2eeca

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,11 @@ describe('data state', () => {
193193
expect(selectors.isLoading(state())).toBe(true);
194194
});
195195
it('should need to fetch the second databaseDocumentID', () => {
196-
expect(selectors.databaseDocumentIDToFetch(state())).toBe(firstDatabaseDocumentID);
196+
expect(selectors.databaseDocumentIDToFetch(state())).toBe(secondDatabaseDocumentID);
197197
});
198198
it('should need to abort the request for the databaseDocumentID', () => {
199199
expect(selectors.databaseDocumentIDToFetch(state())).toBe(secondDatabaseDocumentID);
200200
});
201-
it('should use the correct location for the first resolver', () => {
202-
expect(selectors.resolverComponentInstanceID(state())).toBe(resolverComponentInstanceID1);
203-
});
204201
it('should use the correct location for the second resolver', () => {
205202
expect(selectors.resolverComponentInstanceID(state())).toBe(resolverComponentInstanceID2);
206203
});

x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function isLoading(state: DataState): boolean {
4444
* A string for uniquely identifying the instance of resolver within the app.
4545
*/
4646
export function resolverComponentInstanceID(state: DataState): string {
47-
return state.resolverComponentInstanceID;
47+
return state.resolverComponentInstanceID ? state.resolverComponentInstanceID : '';
4848
}
4949

5050
/**

x-pack/plugins/security_solution/public/resolver/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export interface DataState {
177177
* The id used for the pending request, if there is one.
178178
*/
179179
readonly pendingRequestDatabaseDocumentID?: string;
180-
readonly resolverComponentInstanceID: string;
180+
readonly resolverComponentInstanceID: string | undefined;
181181

182182
/**
183183
* The parameters and response from the last successful request.

0 commit comments

Comments
 (0)