@jeremyckahn/farmhand
Version:
A farming game
24 lines (17 loc) • 583 B
JavaScript
import { testState } from '../../test-utils/index.js'
import { withdrawCow } from './withdrawCow.js'
describe('withdrawCow', () => {
test('makes specified cow unavailable for trade', () => {
const cowId = 'abc123'
let { cowIdOfferedForTrade } = withdrawCow(
testState({ cowIdOfferedForTrade: cowId }),
'some-other-cow'
)
expect(cowIdOfferedForTrade).toEqual(cowId)
cowIdOfferedForTrade = withdrawCow(
testState({ cowIdOfferedForTrade: cowId }),
cowId
).cowIdOfferedForTrade
expect(cowIdOfferedForTrade).toEqual('')
})
})