import { haveAttribute, haveFocus, html, haveClasses, notHaveClasses, test, haveText, notExist, beHidden, } from '../../../utils'
test('it works using x-model',
[html`
`],
({ get }) => {
get('input').should(haveAttribute('value', ''))
get('[option="access-2"]').click()
get('input').should(haveAttribute('value', 'access-2'))
get('[option="access-4"]').click()
get('input').should(haveAttribute('value', 'access-4'))
},
)
test('it works without x-model/with default-value',
[html`
`],
({ get }) => {
get('[option="access-4"]').should(haveAttribute('aria-checked', 'true'))
get('[option="access-2"]').click()
get('[option="access-2"]').should(haveAttribute('aria-checked', 'true'))
},
)
test('cannot select any option when the group is disabled',
[html`
`],
({ get }) => {
get('input').should(haveAttribute('value', ''))
get('[option="access-1"]').click()
get('input').should(haveAttribute('value', ''))
},
)
test('cannot select a disabled option',
[html`
`],
({ get }) => {
get('[option="access-2"]').click()
get('article')
.should(haveText(JSON.stringify({
id: 'access-2',
name: 'Private to Project Members',
description: 'Only members of this project would be able to access',
disabled: false,
})))
},
)
test('name prop',
[html`