From 5b56bda0bbb2075ecf25009ca7427d5c7c762c4c Mon Sep 17 00:00:00 2001 From: mabashian Date: Wed, 19 Aug 2020 12:53:41 -0400 Subject: [PATCH] Fix tests after changing node data structure --- .../Workflow/WorkflowNodeHelp.test.jsx | 14 ++++--- .../WorkflowOutputGraph.test.jsx | 14 ++++--- .../WorkflowOutputNode.test.jsx | 42 +++++++++++-------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.test.jsx b/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.test.jsx index 183119f5e3..9ac9afbacd 100644 --- a/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.test.jsx +++ b/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.test.jsx @@ -9,11 +9,15 @@ describe('WorkflowNodeHelp', () => { }); test('renders the expected content for a completed job template job', () => { const node = { - job: { - name: 'Foo Job Template', - elapsed: 9000, - status: 'successful', - type: 'job', + originalNodeObject: { + summary_fields: { + job: { + name: 'Foo Job Template', + elapsed: 9000, + status: 'successful', + type: 'job', + }, + }, }, unifiedJobTemplate: { name: 'Foo Job Template', diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.test.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.test.jsx index 39de8a7c08..7a70117cef 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.test.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputGraph.test.jsx @@ -64,11 +64,15 @@ const workflowContext = { }, { id: 2, - job: { - name: 'Foo JT', - type: 'job', - status: 'successful', - elapsed: 60, + originalNodeObject: { + summary_fields: { + job: { + name: 'Foo JT', + type: 'job', + status: 'successful', + elapsed: 60, + }, + }, }, }, { diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx index feb9de5b38..a8709ccf4e 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.test.jsx @@ -5,28 +5,36 @@ import WorkflowOutputNode from './WorkflowOutputNode'; const nodeWithJT = { id: 2, - job: { - elapsed: 7, - id: 9000, - name: 'Automation JT', - status: 'successful', - type: 'job', - }, - unifiedJobTemplate: { - id: 77, - name: 'Automation JT', - unified_job_type: 'job', + originalNodeObject: { + summary_fields: { + job: { + elapsed: 7, + id: 9000, + name: 'Automation JT', + status: 'successful', + type: 'job', + }, + }, + unifiedJobTemplate: { + id: 77, + name: 'Automation JT', + unified_job_type: 'job', + }, }, }; const nodeWithoutJT = { id: 2, - job: { - elapsed: 7, - id: 9000, - name: 'Automation JT 2', - status: 'successful', - type: 'job', + originalNodeObject: { + summary_fields: { + job: { + elapsed: 7, + id: 9000, + name: 'Automation JT 2', + status: 'successful', + type: 'job', + }, + }, }, };