fix(cms): keep the Atlantisz reference pending until logo and name are settled (MITHOME-133)
The Atlantisz logo has white lettering made for a dark header, invisible on our light background, and its official name differs between the logo and the admin entry. The partner_references migration now classifies it as a pending client reference in environments where it has not run yet; the follow-up 20260929_atlantisz_pending migration moves the already granted staging entry to pending, touching only the automatic classification (a later admin decision is left alone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c6a4bd9bc9
commit
3505806358
@@ -1,4 +1,5 @@
|
||||
import { classifyPartner, seedReferencesSection, up } from '../migrations/20260929_partner_references'
|
||||
import { markAtlantiszPending, PENDING_REFERENCE } from '../migrations/20260929_atlantisz_pending'
|
||||
import { fakeArgs, fakeCollection } from './helpers/fake-mongo'
|
||||
|
||||
type Doc = Record<string, unknown>
|
||||
@@ -11,10 +12,25 @@ describe('20260929_partner_references migration (MITHOME-131)', () => {
|
||||
expect(doc.permissionReference).toMatch(/Írásos engedély/)
|
||||
})
|
||||
|
||||
it('should mark the Atlantisz contracted client as a client reference too', () => {
|
||||
it('should mark the Atlantisz contracted client as a client reference, pending until its logo is settled', () => {
|
||||
const doc: Doc = { name: 'Atlantisz Horgászüdülő és Halásztanya' }
|
||||
classifyPartner(doc)
|
||||
expect(doc).toMatchObject({ relationship: 'client-reference', publicationPermission: 'granted' })
|
||||
expect(doc).toMatchObject({ relationship: 'client-reference', publicationPermission: 'pending' })
|
||||
})
|
||||
|
||||
it('should move an already granted Atlantisz entry to pending, but respect later admin decisions', () => {
|
||||
const auto: Doc = {
|
||||
name: 'Atlantisz Horgászüdülő és Halásztanya',
|
||||
publicationPermission: 'granted',
|
||||
permissionReference: 'Írásos engedély megvan (tulajdonosi megerősítés, 2026-09-29)',
|
||||
}
|
||||
expect(markAtlantiszPending(auto)).toBe(1)
|
||||
expect(auto).toMatchObject({ publicationPermission: 'pending', permissionReference: PENDING_REFERENCE })
|
||||
expect(markAtlantiszPending(auto)).toBe(0)
|
||||
const admin: Doc = { name: 'Atlantisz Horgászüdülő és Halásztanya', publicationPermission: 'granted', permissionReference: 'E-mail, 2026-10-05' }
|
||||
expect(markAtlantiszPending(admin)).toBe(0)
|
||||
const angele: Doc = { name: 'Angele Pihenőház', publicationPermission: 'granted', permissionReference: 'Írásos engedély megvan (tulajdonosi megerősítés, 2026-09-29)' }
|
||||
expect(markAtlantiszPending(angele)).toBe(0)
|
||||
})
|
||||
|
||||
it('should hide any other uncategorised entry until someone classifies it', () => {
|
||||
|
||||
Reference in New Issue
Block a user