mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-29 17:43:05 +00:00
fix: resolve rebase conflict markers in quick-action unit spec
This commit is contained in:
parent
73159f0cb4
commit
66e84ab85c
1 changed files with 17 additions and 22 deletions
|
|
@ -1,9 +1,17 @@
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
import { UNCOVERED_MUNICIPALITIES_LIST_HREF, homeActionsForRole } from '@/lib/campaignHomeActions'
|
|
||||||
=======
|
|
||||||
import { resolveActivityQuickActions } from '@/lib/activityQuickActions'
|
import { resolveActivityQuickActions } from '@/lib/activityQuickActions'
|
||||||
|
import { CAMPAIGN_WIZARD_ACTION_SLUGS } from '@/lib/campaignActionRoutes'
|
||||||
|
import {
|
||||||
|
UNCOVERED_MUNICIPALITIES_LIST_HREF,
|
||||||
|
homeActionsForRole,
|
||||||
|
} from '@/lib/campaignHomeActions'
|
||||||
|
import {
|
||||||
|
isCampaignActionsPath,
|
||||||
|
isCampaignHomePath,
|
||||||
|
isLeaderContactsPath,
|
||||||
|
shouldMountQuickActionsDrawer,
|
||||||
|
} from '@/lib/campaignQuickActionMount'
|
||||||
import {
|
import {
|
||||||
ACTIVITY_LIST_PATH,
|
ACTIVITY_LIST_PATH,
|
||||||
ACTIVITY_NEW_PATH,
|
ACTIVITY_NEW_PATH,
|
||||||
|
|
@ -11,20 +19,12 @@ import {
|
||||||
isActivityTourComposerPath,
|
isActivityTourComposerPath,
|
||||||
parseActivityQuickActionSurface,
|
parseActivityQuickActionSurface,
|
||||||
} from '@/lib/campaignQuickActionPaths'
|
} from '@/lib/campaignQuickActionPaths'
|
||||||
>>>>>>> ccc5faf (B84 — Ações rápidas na vertical Atividades (lista + detalhe))
|
|
||||||
import {
|
|
||||||
isCampaignActionsPath,
|
|
||||||
isCampaignHomePath,
|
|
||||||
isLeaderContactsPath,
|
|
||||||
shouldMountQuickActionsDrawer,
|
|
||||||
} from '@/lib/campaignQuickActionMount'
|
|
||||||
import { resolveQuickActionsForPath } from '@/lib/campaignQuickActionRegistry'
|
import { resolveQuickActionsForPath } from '@/lib/campaignQuickActionRegistry'
|
||||||
import {
|
import {
|
||||||
QUICK_ACTIONS_SNAP_COLLAPSED,
|
QUICK_ACTIONS_SNAP_COLLAPSED,
|
||||||
QUICK_ACTIONS_SNAP_EXPANDED,
|
QUICK_ACTIONS_SNAP_EXPANDED,
|
||||||
quickActionsSnapIsExpanded,
|
quickActionsSnapIsExpanded,
|
||||||
} from '@/lib/campaignQuickActionSnap'
|
} from '@/lib/campaignQuickActionSnap'
|
||||||
import { CAMPAIGN_WIZARD_ACTION_SLUGS } from '@/lib/campaignActionRoutes'
|
|
||||||
|
|
||||||
describe('campaignQuickActionMount', () => {
|
describe('campaignQuickActionMount', () => {
|
||||||
it('treats Início as exact match only', () => {
|
it('treats Início as exact match only', () => {
|
||||||
|
|
@ -97,7 +97,9 @@ describe('activityQuickActions (B84)', () => {
|
||||||
|
|
||||||
expect(actions.some((action) => action.id === 'update-votes')).toBe(true)
|
expect(actions.some((action) => action.id === 'update-votes')).toBe(true)
|
||||||
expect(
|
expect(
|
||||||
actions.find((action) => action.id === 'update-votes')?.href?.includes('municipio=feira-de-santana'),
|
actions
|
||||||
|
.find((action) => action.id === 'update-votes')
|
||||||
|
?.href?.includes('municipio=feira-de-santana'),
|
||||||
).toBe(true)
|
).toBe(true)
|
||||||
expect(actions.find((action) => action.id === 'edit-activity')?.href).toBe(
|
expect(actions.find((action) => action.id === 'edit-activity')?.href).toBe(
|
||||||
'/campanha/atividades/comicio-feira/editar',
|
'/campanha/atividades/comicio-feira/editar',
|
||||||
|
|
@ -124,7 +126,6 @@ describe('activityQuickActions (B84)', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('campaignQuickActionRegistry', () => {
|
describe('campaignQuickActionRegistry', () => {
|
||||||
<<<<<<< HEAD
|
|
||||||
const staffActionIds = homeActionsForRole('coordinator').map((action) => action.id)
|
const staffActionIds = homeActionsForRole('coordinator').map((action) => action.id)
|
||||||
|
|
||||||
it('returns empty catalog for unregistered paths', () => {
|
it('returns empty catalog for unregistered paths', () => {
|
||||||
|
|
@ -133,9 +134,6 @@ describe('campaignQuickActionRegistry', () => {
|
||||||
municipalitySlug: 'foo',
|
municipalitySlug: 'foo',
|
||||||
}),
|
}),
|
||||||
).toEqual([])
|
).toEqual([])
|
||||||
=======
|
|
||||||
it('returns empty catalog on unrelated staff routes', () => {
|
|
||||||
expect(resolveQuickActionsForPath('/campanha/municipios/foo', 'coordinator', {})).toEqual([])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('delegates activity routes to the B84 catalog', () => {
|
it('delegates activity routes to the B84 catalog', () => {
|
||||||
|
|
@ -144,16 +142,13 @@ describe('campaignQuickActionRegistry', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('builds wizard hrefs with municipality slug from context', () => {
|
it('builds wizard hrefs with municipality slug from context', () => {
|
||||||
const actions = resolveQuickActionsForPath(
|
const actions = resolveQuickActionsForPath('/campanha/atividades/evento-zona-1', 'coordinator', {
|
||||||
'/campanha/atividades/evento-zona-1',
|
municipalitySlug: 'salvador-ze-01',
|
||||||
'coordinator',
|
})
|
||||||
{ municipalitySlug: 'salvador-ze-01' },
|
|
||||||
)
|
|
||||||
const registerSignal = actions.find((action) => action.id === 'register-signal')
|
const registerSignal = actions.find((action) => action.id === 'register-signal')
|
||||||
expect(registerSignal?.href).toBe(
|
expect(registerSignal?.href).toBe(
|
||||||
`/campanha/acoes/${CAMPAIGN_WIZARD_ACTION_SLUGS['register-signal']}?municipio=salvador-ze-01`,
|
`/campanha/acoes/${CAMPAIGN_WIZARD_ACTION_SLUGS['register-signal']}?municipio=salvador-ze-01`,
|
||||||
)
|
)
|
||||||
>>>>>>> ccc5faf (B84 — Ações rápidas na vertical Atividades (lista + detalhe))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns staff Início catalog on territorios without municipality prefill (B81)', () => {
|
it('returns staff Início catalog on territorios without municipality prefill (B81)', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue