Migrate more to Jotai (#17968)

As per title

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
This commit is contained in:
Charles Bochet
2026-02-17 19:24:36 +01:00
committed by GitHub
parent 98482f3a01
commit d7f025157b
179 changed files with 1219 additions and 988 deletions
@@ -0,0 +1,15 @@
import { canOpenObjectInSidePanel } from '@/object-record/utils/canOpenObjectInSidePanel';
describe('canOpenObjectInSidePanel', () => {
it('should return false for workflow objects', () => {
expect(canOpenObjectInSidePanel('workflow')).toBe(false);
expect(canOpenObjectInSidePanel('workflowVersion')).toBe(false);
expect(canOpenObjectInSidePanel('dashboard')).toBe(false);
});
it('should return true for other objects', () => {
expect(canOpenObjectInSidePanel('person')).toBe(true);
expect(canOpenObjectInSidePanel('company')).toBe(true);
expect(canOpenObjectInSidePanel('task')).toBe(true);
});
});
@@ -0,0 +1,43 @@
import { computeNewEvenlySpacedPositions } from '@/object-record/utils/computeNewEvenlySpacedPositions';
describe('computeNewEvenlySpacedPositions', () => {
it('should compute evenly spaced positions between two values', () => {
const result = computeNewEvenlySpacedPositions({
startingPosition: 0,
endingPosition: 10,
numberOfRecordsToInsertBetween: 4,
});
expect(result).toEqual([2, 4, 6, 8]);
});
it('should return a single midpoint when inserting one record', () => {
const result = computeNewEvenlySpacedPositions({
startingPosition: 0,
endingPosition: 10,
numberOfRecordsToInsertBetween: 1,
});
expect(result).toEqual([5]);
});
it('should return all same values when gap is zero', () => {
const result = computeNewEvenlySpacedPositions({
startingPosition: 5,
endingPosition: 5,
numberOfRecordsToInsertBetween: 3,
});
expect(result).toEqual([5, 5, 5]);
});
it('should throw when starting position is after ending position', () => {
expect(() =>
computeNewEvenlySpacedPositions({
startingPosition: 10,
endingPosition: 5,
numberOfRecordsToInsertBetween: 1,
}),
).toThrow();
});
});