Fix getters mutating state on repeated access
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -196,5 +196,18 @@ describe('conformanceStore', () => {
|
||||
// The date attribute should show minutes (30), not month (06)
|
||||
expect(result[0].attributes[0].value).toMatch(/:30:/);
|
||||
});
|
||||
|
||||
it('cases getter does not corrupt original state on repeated access', () => {
|
||||
const originalDate = '2023-06-15T10:30:00Z';
|
||||
store.allCases = [{
|
||||
started_at: originalDate,
|
||||
completed_at: '2023-06-15T11:45:00Z',
|
||||
facets: [],
|
||||
attributes: [],
|
||||
}];
|
||||
store.cases;
|
||||
// Original state should still contain the ISO date
|
||||
expect(store.allCases[0].started_at).toBe(originalDate);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user