mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* Add workspace Agents and permission management * fix: remove all duplicate team subject memberships * fix: align agent team role inheritance with users * fix: delegate workspace role storage to subject types * fix: preserve agent team memberships through trash * Fix migration conflict * fix: save agent settings pages independently * fix: preserve agent roles across license changes * fix: stabilize agent list pagination * fix: filter agent websocket events by list permission * fix: authorize agent team membership changes * fix: serialize concurrent agent team updates * fix: refresh agent teams through realtime events * fix: restrict personal views to user subjects * fix: deny agents with unavailable roles * fix: exclude agents in trashed workspaces * test: cover permanent agent access cleanup * fix: gate agents in team selectors * fix: accept trash option for preview actors * fix: set native agent form button types * fix: ignore stale agent modal saves * fix: show permitted agent management actions * fix: validate subject lookup fields * perf: optimize batched user membership checks * perf: cache agent team feature per list * fix: map agent nonmember API errors * fix: document paginated agent API schema * fix: stabilize agent API schema operations * fix: show agent name validation errors * fix: show total agent count * test: cover agent creation submissions * test: cover agent and subject UI behavior * docs: define direct subject role contracts * fix: clarify team access management * fix: use standard empty agents table * fix: align agent name column styling * refactor: move agent trash import * refactor: align agent extension registry naming * fix: recover agent team selector loading * fix: validate every subject in role batches * fix: ignore stale agent list responses * perf: index recent team subjects * fix: restore role handler imports * Fix lint * fix: reuse prefetched user memberships * fix: preserve low priority role fallback * fix: preserve trashed field permission subjects * fix: open team picker when agent loading fails * Fix tests
61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
import { mountSuspended } from '@nuxt/test-utils/runtime'
|
|
|
|
import RadioButton from '@baserow/modules/core/components/RadioButton'
|
|
|
|
describe('RadioButton.vue', () => {
|
|
test('renders a non-submit button', async () => {
|
|
const wrapper = await mountSuspended(RadioButton)
|
|
|
|
expect(wrapper.find('button').attributes('type')).toBe('button')
|
|
})
|
|
|
|
it('renders the button', async () => {
|
|
const wrapper = await mountSuspended(RadioButton)
|
|
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
})
|
|
|
|
it('passes the correct props to the button', async () => {
|
|
const propsData = {
|
|
loading: true,
|
|
disabled: true,
|
|
icon: 'test-icon',
|
|
title: 'test-title',
|
|
}
|
|
const wrapper = await mountSuspended(RadioButton, { props: propsData })
|
|
|
|
expect(wrapper.html()).toMatchSnapshot()
|
|
})
|
|
|
|
it('emits input event with the correct value when the button is clicked', async () => {
|
|
const value = 'test'
|
|
const onClick = vi.fn()
|
|
const wrapper = await mountSuspended(RadioButton, {
|
|
props: {
|
|
value,
|
|
onClick,
|
|
},
|
|
})
|
|
|
|
await wrapper.findComponent({ name: 'Button' }).trigger('click')
|
|
|
|
expect(onClick).toHaveBeenCalled()
|
|
})
|
|
|
|
it('can emit a deselected value when the active button is clicked', async () => {
|
|
const wrapper = await mountSuspended(RadioButton, {
|
|
props: {
|
|
modelValue: true,
|
|
value: true,
|
|
allowDeselect: true,
|
|
deselectedValue: false,
|
|
},
|
|
})
|
|
|
|
await wrapper.findComponent({ name: 'Button' }).trigger('click')
|
|
|
|
expect(wrapper.emitted('update:modelValue')).toEqual([[false]])
|
|
expect(wrapper.emitted('input')).toEqual([[false]])
|
|
})
|
|
})
|