From 33d2d848e1ac2260a306def502c35ce39a89a53f Mon Sep 17 00:00:00 2001 From: Thodoris Greasidis Date: Thu, 27 Jun 2024 17:03:59 +0300 Subject: [PATCH] squash me --- src/features/devices/models/device-additions.ts | 2 +- test/scenarios/unpin-device-after-release.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/features/devices/models/device-additions.ts b/src/features/devices/models/device-additions.ts index eb0b11313b..0e51109cc4 100644 --- a/src/features/devices/models/device-additions.ts +++ b/src/features/devices/models/device-additions.ts @@ -387,7 +387,7 @@ export const addToModel = (abstractSql: AbstractSqlModel) => { ], [ 'Coalesce', - ['ReferencedField', 'device', 'should be running-release'], + ['ReferencedField', 'device', 'is pinned on-release'], [ 'SelectQuery', [ diff --git a/test/scenarios/unpin-device-after-release.ts b/test/scenarios/unpin-device-after-release.ts index 710921e44f..04677ada86 100644 --- a/test/scenarios/unpin-device-after-release.ts +++ b/test/scenarios/unpin-device-after-release.ts @@ -12,10 +12,18 @@ import { addServiceToApp, addImageToRelease, } from '../test-lib/api-helpers.js'; +import * as versions from '../test-lib/versions.js'; const version = 'resin'; export default () => { + // we don't really need `versions.gt` here since `const version = 'resin';`, + // but used it anyway for consistency and in case we later prefer to run + // the scenarion with multiple versions. + const pinnedOnReleaseField = versions.gt(version, 'v6') + ? 'is_pinned_on__release' + : 'should_be_running__release'; + describe('Device with missing service installs', () => { let fx: fixtures.Fixtures; let admin: UserObjectParam; @@ -81,7 +89,7 @@ export default () => { await supertest(admin) .patch(`/${version}/device(${device.id})`) .send({ - should_be_running__release: releases['deadbeef'], + [pinnedOnReleaseField]: releases['deadbeef'], }) .expect(200); @@ -163,7 +171,7 @@ export default () => { await supertest(admin) .patch(`/${version}/device(${device.id})`) .send({ - should_be_running__release: null, + [pinnedOnReleaseField]: null, }) .expect(200); });