|
1 | 1 | import { beforeEach, describe, expect, it } from 'vitest' |
2 | 2 |
|
3 | 3 | import Execution from '@/models/execution' |
4 | | -import ExecutionStep from '@/models/execution-step' |
5 | 4 | import Flow from '@/models/flow' |
6 | 5 | import User from '@/models/user' |
7 | 6 |
|
@@ -234,57 +233,5 @@ describe('get test execution steps', () => { |
234 | 233 | testExecution2.executionSteps[1].id, |
235 | 234 | ]) |
236 | 235 | }) |
237 | | - |
238 | | - it('should return the latest test execution steps if ignoreTestExecutionId is set to true', async () => { |
239 | | - const testExecution2 = await Execution.query().insertGraphAndFetch({ |
240 | | - flowId: flow.id, |
241 | | - testRun: true, |
242 | | - executionSteps: [ |
243 | | - { |
244 | | - stepId: flow.steps[0].id, |
245 | | - status: 'success', |
246 | | - dataOut: { someData: 'data' }, |
247 | | - }, |
248 | | - { |
249 | | - stepId: flow.steps[1].id, |
250 | | - status: 'success', |
251 | | - dataOut: { someData: 'data' }, |
252 | | - }, |
253 | | - ], |
254 | | - }) |
255 | | - await flow.$query().patch({ testExecutionId: testExecution1.id }) |
256 | | - const testExecutionSteps = await getTestExecutionSteps(flow.id, true) |
257 | | - expect(testExecutionSteps).to.toHaveLength(3) |
258 | | - expect(testExecutionSteps.map((step) => step.id)).toEqual([ |
259 | | - testExecution2.executionSteps[0].id, |
260 | | - testExecution2.executionSteps[1].id, |
261 | | - testExecution1.executionSteps[2].id, |
262 | | - ]) |
263 | | - }) |
264 | | - |
265 | | - it('should return the latest test execution steps if more than 1 found for a step', async () => { |
266 | | - const dupes = await ExecutionStep.query().insert([ |
267 | | - { |
268 | | - executionId: testExecution1.id, |
269 | | - stepId: flow.steps[0].id, |
270 | | - status: 'success', |
271 | | - dataOut: { someData: 'data' }, |
272 | | - }, |
273 | | - { |
274 | | - executionId: testExecution1.id, |
275 | | - stepId: flow.steps[1].id, |
276 | | - status: 'success', |
277 | | - dataOut: { someData: 'data' }, |
278 | | - }, |
279 | | - ]) |
280 | | - await flow.$query().patch({ testExecutionId: testExecution1.id }) |
281 | | - const testExecutionSteps = await getTestExecutionSteps(flow.id, true) |
282 | | - expect(testExecutionSteps).to.toHaveLength(3) |
283 | | - expect(testExecutionSteps.map((step) => step.id)).toEqual([ |
284 | | - dupes[0].id, |
285 | | - dupes[1].id, |
286 | | - testExecution1.executionSteps[2].id, |
287 | | - ]) |
288 | | - }) |
289 | 236 | }) |
290 | 237 | }) |
0 commit comments