Skip to content

Commit

Permalink
ensure targetSnapshotId and activePipelineStageId are set
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Mcl committed Jan 10, 2024
1 parent c6b5099 commit e640b03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/unit/forge/ee/routes/api/pipeline_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@ describe('Pipelines API', function () {
// this way we can test that the group and a device within it are all updated
await TestObjects.deviceGroupTwo.addDevice(TestObjects.deviceTwo)

await createSnapshot(app, TestObjects.instanceOne, TestObjects.user, {
const snapshot = await createSnapshot(app, TestObjects.instanceOne, TestObjects.user, {
name: 'Existing Snapshot Created In Test',
description: 'This was the second snapshot created as part of the test process',
setAsTarget: false // no need to deploy to devices of the source
Expand Down Expand Up @@ -2285,6 +2285,12 @@ describe('Pipelines API', function () {
deviceGroups[0].should.have.property('isDeploying', true)
deviceGroups[0].should.have.property('hasTargetSnapshot', true)
deviceGroups[0].should.have.property('targetMatchCount', 1)
const deviceData = await app.db.models.Device.getAll({}, { id: TestObjects.deviceTwo.id })
const device = deviceData.devices[0]
const deviceGroupData = await app.db.models.DeviceGroup.getAll({}, { id: TestObjects.deviceGroupTwo.id })
const deviceGroup = deviceGroupData.groups[0]
device.should.have.property('targetSnapshotId', snapshot.id)
deviceGroup.should.have.property('activePipelineStageId', TestObjects.stageTwo.id)
})
})

Expand Down

0 comments on commit e640b03

Please sign in to comment.