import { checkActions } from './models'; describe('version checks', () => { it('enables promotion only when the API says the version is promotable', () => { expect(checkActions({ status: 'candidate', promotable: false, checks: [] }).promote).toBe( false, ); expect(checkActions({ status: 'candidate', promotable: true, checks: [] }).promote).toBe(true); expect(checkActions({ status: 'retired', promotable: false, checks: [] }).promote).toBe(false); }); it('disables retirement for the champion', () => { expect(checkActions({ status: 'champion', promotable: true, checks: [] }).retire).toBe(false); expect(checkActions({ status: 'candidate', promotable: true, checks: [] }).retire).toBe(true); }); });