Skip to content
← Public packages

@kody/kody-factory

Forkable multi-project software factory: signals, priority queue, project UI, sweep job. Agent runners and Sentry reach it by events.

FollowFork

Files

labels.test.ts

21 lines · 960 B · TypeScript
import { test } from 'node:test'
import assert from 'node:assert/strict'
import { outcomeLabel } from './labels.ts'

const item = (state: string, priority: number | null = 2) => ({ state, priority }) as never

test('dropped item whose source issue was completed counts as a work item', () => {
	assert.equal(outcomeLabel(item('dropped'), 'completed'), 'create_work_item')
})

test('dropped item closed as not planned, duplicate, or unknown stays ignore', () => {
	assert.equal(outcomeLabel(item('dropped'), 'not_planned'), 'ignore')
	assert.equal(outcomeLabel(item('dropped'), 'duplicate'), 'ignore')
	assert.equal(outcomeLabel(item('dropped'), null), 'ignore')
	assert.equal(outcomeLabel(item('dropped')), 'ignore')
})

test('shipped and needs-kent items are work items regardless of source reason', () => {
	assert.equal(outcomeLabel(item('shipped'), 'not_planned'), 'create_work_item')
	assert.equal(outcomeLabel(item('needs-kent')), 'create_work_item')
})