WP-11: contract and failing tests for package upgrades
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@ -35,3 +35,15 @@ describe('PackageTable', () => {
|
||||
expect(rows(w)[0]).toContain('microk8s')
|
||||
})
|
||||
})
|
||||
|
||||
describe('PackageTable selection', () => {
|
||||
it('lets the user select upgradable packages and emits the names', async () => {
|
||||
const w = mount(PackageTable, { props: { packages: pkgs, selectable: true } })
|
||||
const boxes = w.findAll('input[name=select]')
|
||||
expect(boxes).toHaveLength(2) // only upgradable rows get a checkbox
|
||||
await boxes[0].setValue(true)
|
||||
expect(w.emitted('update:selected')!.at(-1)![0]).toEqual(['openssl'])
|
||||
await boxes[1].setValue(true)
|
||||
expect(w.emitted('update:selected')!.at(-1)![0]).toEqual(['openssl', 'curl'])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user