test: cover account bulk edit target scopes
This commit is contained in:
@@ -217,4 +217,41 @@ describe('BulkEditAccountModal', () => {
|
||||
})
|
||||
expect(wrapper.text()).toContain('admin.accounts.openai.modelRestrictionDisabledByPassthrough')
|
||||
})
|
||||
|
||||
it('filtered-results 模式下应提交 filters 而不是 account_ids', async () => {
|
||||
const wrapper = mountModal({
|
||||
accountIds: [],
|
||||
target: {
|
||||
mode: 'filtered',
|
||||
filters: {
|
||||
platform: 'openai',
|
||||
type: 'oauth',
|
||||
status: 'active',
|
||||
group: '12',
|
||||
search: 'bulk-target',
|
||||
privacy_mode: 'training_set_cf_blocked'
|
||||
},
|
||||
previewCount: 5,
|
||||
selectedPlatforms: ['openai'],
|
||||
selectedTypes: ['oauth']
|
||||
}
|
||||
})
|
||||
|
||||
await wrapper.get('#bulk-edit-status-enabled').setValue(true)
|
||||
await wrapper.get('#bulk-edit-account-form').trigger('submit.prevent')
|
||||
await flushPromises()
|
||||
|
||||
expect(adminAPI.accounts.bulkUpdate).toHaveBeenCalledTimes(1)
|
||||
expect(adminAPI.accounts.bulkUpdate).toHaveBeenCalledWith({
|
||||
filters: {
|
||||
platform: 'openai',
|
||||
type: 'oauth',
|
||||
status: 'active',
|
||||
group: '12',
|
||||
search: 'bulk-target',
|
||||
privacy_mode: 'training_set_cf_blocked'
|
||||
},
|
||||
status: 'active'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user