Skip to content

Commit

Permalink
EMT-248: use union type, do some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nnamdifrankie committed Mar 19, 2020
1 parent d343c93 commit 74a4729
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_manager/common/types/models/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export interface NewAgentAction {
sent_at?: string;
}

export interface AgentAction extends NewAgentAction, SavedObjectAttributes {
export type AgentAction = NewAgentAction & {
id: string;
created_at: string;
}
} & SavedObjectAttributes;

export interface AgentEvent {
type: 'STATE' | 'ERROR' | 'ACTION_RESULT' | 'ACTION';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('test actions handlers', () => {
});

it('should succeed on valid new agent action', async () => {
const mockRequest = httpServerMock.createKibanaRequest(({
const postNewAgentActionRequest: PostNewAgentActionRequest = {
body: {
action: {
type: 'CONFIG_CHANGE',
Expand All @@ -62,7 +62,9 @@ describe('test actions handlers', () => {
params: {
agentId: 'id',
},
} as unknown) as PostNewAgentActionRequest);
};

const mockRequest = httpServerMock.createKibanaRequest(postNewAgentActionRequest);

const agentAction = ({
type: 'CONFIG_CHANGE',
Expand Down

0 comments on commit 74a4729

Please sign in to comment.