#49 fix: labels en nodos de gráficos y municipio con departamento en proveedores
This commit is contained in:
@@ -10,8 +10,13 @@ const organizations = [
|
||||
]
|
||||
|
||||
const municipalities = [
|
||||
{ id: 7, name: 'La Mesa' },
|
||||
{ id: 8, name: 'San Antonio' },
|
||||
{ id: 7, name: 'La Mesa', department: 2 },
|
||||
{ id: 8, name: 'San Antonio', department: 3 },
|
||||
]
|
||||
|
||||
const departments = [
|
||||
{ id: 2, name: 'Cundinamarca' },
|
||||
{ id: 3, name: 'Antioquia' },
|
||||
]
|
||||
|
||||
const suppliers = [
|
||||
@@ -44,6 +49,7 @@ function mockApi () {
|
||||
getSuppliers: vi.fn().mockResolvedValue(suppliers),
|
||||
getOrganizations: vi.fn().mockResolvedValue(organizations),
|
||||
getMunicipalities: vi.fn().mockResolvedValue(municipalities),
|
||||
getDepartments: vi.fn().mockResolvedValue(departments),
|
||||
createSupplier: vi.fn().mockResolvedValue({}),
|
||||
updateSupplier: vi.fn().mockResolvedValue({}),
|
||||
deleteSupplier: vi.fn().mockResolvedValue({}),
|
||||
@@ -68,6 +74,18 @@ describe('SuppliersManagement', () => {
|
||||
expect(wrapper.text()).toContain('La Mesa')
|
||||
})
|
||||
|
||||
it('muestra el departamento en el título del municipio', async () => {
|
||||
const api = mockApi()
|
||||
const wrapper = mountComponent(api)
|
||||
await flushPromises()
|
||||
|
||||
await wrapper.find('[data-testid="supplier-create"]').trigger('click')
|
||||
const autocomplete = wrapper.findAllComponents({ name: 'VAutocomplete' })[0]
|
||||
const itemTitle = autocomplete.props('itemTitle')
|
||||
|
||||
expect(itemTitle({ id: 7, name: 'La Mesa', department: 2 })).toBe('La Mesa (Cundinamarca)')
|
||||
})
|
||||
|
||||
it('crea un proveedor con organización y municipio', async () => {
|
||||
const api = mockApi()
|
||||
const wrapper = mountComponent(api)
|
||||
|
||||
Reference in New Issue
Block a user