chore(autonomous-session): consolidate uncommitted work from prior session
Bundles the prior autonomous-session output that was sitting unstaged: - Em-dash sweep across src/ + tests/ (en-dash/em-dash to hyphen, ~2280 instances) - country-flag-icons rollout (CountryFlag component, replaces emoji glyphs that never rendered on Windows; lazy-loads the 3x2 SVG index as a single chunk after the per-subpath dynamic-import approach silently failed in webpack) - Admin IA Phase 1+2: 7-domain regroup, 41 to 38 pages, /admin/berths index, redirects (ocr to ai, reports to dashboard, invitations to users), docs/admin-ia-proposal.md - Per-template email tester (registry + endpoint + UI on Email admin page) - Cancel-document mode picker (delete-from-Documenso vs keep-for-audit) - Dashboard PDF report: 25 widgets, SVG charts, date-range picker, 11 resolvers - Customize-widgets per-region sortables at xl+ (charts/rails/feed); single flat sortable below xl when the layout stacks; per-viewport saved orders - Audit doc updates capturing each shipped item - Lint fixes: react-compiler immutability in DonutChart (reduce instead of let-reassign), set-state-in-effect disables in CountryFlag and UploadForSigning preview-bytes effect, unused 'confirm' destructures in interest contract + reservation tabs, unescaped apostrophe in test-template card copy
This commit is contained in:
@@ -18,7 +18,7 @@ import { deepMerge } from '@/lib/api/helpers';
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe('deepMerge — basic override behaviour', () => {
|
||||
describe('deepMerge - basic override behaviour', () => {
|
||||
it('override replaces a single base value', () => {
|
||||
const base = { clients: { view: true, create: true, delete: false } };
|
||||
const override = { clients: { delete: true } };
|
||||
@@ -52,7 +52,7 @@ describe('deepMerge — basic override behaviour', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('deepMerge — nested structure preservation', () => {
|
||||
describe('deepMerge - nested structure preservation', () => {
|
||||
it('deep merges two levels of nesting without data loss', () => {
|
||||
const base = { admin: { manage_users: false, manage_settings: true } };
|
||||
const override = { admin: { manage_users: true } };
|
||||
@@ -65,7 +65,10 @@ describe('deepMerge — nested structure preservation', () => {
|
||||
const base = { reports: { export: { csv: true, pdf: false } } };
|
||||
const override = { reports: { export: { pdf: true } } };
|
||||
const result = deepMerge(base, override);
|
||||
const exportPerms = (result.reports as Record<string, unknown>).export as Record<string, boolean>;
|
||||
const exportPerms = (result.reports as Record<string, unknown>).export as Record<
|
||||
string,
|
||||
boolean
|
||||
>;
|
||||
expect(exportPerms.pdf).toBe(true);
|
||||
expect(exportPerms.csv).toBe(true);
|
||||
});
|
||||
@@ -89,7 +92,7 @@ describe('deepMerge — nested structure preservation', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('deepMerge — immutability', () => {
|
||||
describe('deepMerge - immutability', () => {
|
||||
it('does not mutate the target object', () => {
|
||||
const base = { clients: { view: true, delete: false } };
|
||||
const override = { clients: { delete: true } };
|
||||
@@ -106,7 +109,7 @@ describe('deepMerge — immutability', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('deepMerge — edge cases', () => {
|
||||
describe('deepMerge - edge cases', () => {
|
||||
it('empty override returns a copy of the base', () => {
|
||||
const base = { clients: { view: true } };
|
||||
const result = deepMerge(base, {});
|
||||
@@ -126,7 +129,7 @@ describe('deepMerge — edge cases', () => {
|
||||
|
||||
it('scalar override value wins over nested base value (array not merged)', () => {
|
||||
// When source has a non-object value for a key that base has as an object,
|
||||
// the source scalar replaces the base object — this is the defined behaviour
|
||||
// the source scalar replaces the base object - this is the defined behaviour
|
||||
const base = { meta: { x: 1 } };
|
||||
const override = { meta: 'string-value' };
|
||||
const result = deepMerge(base, override as unknown as Record<string, unknown>);
|
||||
|
||||
Reference in New Issue
Block a user