Skip to content

Commit

Permalink
squash me
Browse files Browse the repository at this point in the history
  • Loading branch information
thgreasi committed Jun 27, 2024
1 parent 9bcab91 commit 33d2d84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/features/devices/models/device-additions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export const addToModel = (abstractSql: AbstractSqlModel) => {
],
[
'Coalesce',
['ReferencedField', 'device', 'should be running-release'],
['ReferencedField', 'device', 'is pinned on-release'],
[
'SelectQuery',
[
Expand Down
12 changes: 10 additions & 2 deletions test/scenarios/unpin-device-after-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -163,7 +171,7 @@ export default () => {
await supertest(admin)
.patch(`/${version}/device(${device.id})`)
.send({
should_be_running__release: null,
[pinnedOnReleaseField]: null,
})
.expect(200);
});
Expand Down

0 comments on commit 33d2d84

Please sign in to comment.