1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00

fix bug with test results

This commit is contained in:
Peter Clement 2021-11-18 11:41:51 +00:00
parent e81a008a1a
commit ace9d9b878
3 changed files with 7 additions and 5 deletions

View file

@ -87,13 +87,15 @@ const automationActions = store => ({
const response = await api.post(`/api/automations/${_id}/test`, testData)
const json = await response.json()
store.update(state => {
state.selectedAutomation.automation.testResults = json
state.selectedAutomation.testResults = json
return state
})
},
select: automation => {
store.update(state => {
let testResults = state.selectedAutomation?.testResults
state.selectedAutomation = new Automation(cloneDeep(automation))
state.selectedAutomation.testResults = testResults
state.selectedBlock = null
return state
})

View file

@ -25,11 +25,10 @@
let resultsModal
let setupToggled
let blockComplete
$: testResult =
$automationStore.selectedAutomation.automation.testResults?.steps.filter(
step => step.stepId === block.stepId
)
$: testResult = $automationStore.selectedAutomation.testResults?.steps.filter(
step => step.stepId === block.stepId
)
$: isTrigger = block.type === "TRIGGER"
$: selected = $automationStore.selectedBlock?.id === block.id

View file

@ -9,6 +9,7 @@
onMount(() => {
automationStore.actions.fetch()
})
function selectAutomation(automation) {
automationStore.actions.select(automation)
$goto(`./${automation._id}`)