mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
fix(ci): typed card points, the managed take route, and the failing card tests and ratchets
This commit is contained in:
@@ -224,11 +224,7 @@ describe('pickBookPhotos', () => {
|
||||
|
||||
it('PHOTOPICK-010: without signals a caption wins, then a photo the book does not have yet, best first', () => {
|
||||
const result = pickBookPhotos(
|
||||
[
|
||||
at(1, '09:00:00', { inBook: true }),
|
||||
at(2, '10:00:00'),
|
||||
at(3, '11:00:00', { caption: 'Tram 28', inBook: true }),
|
||||
],
|
||||
[at(1, '09:00:00', { inBook: true }), at(2, '10:00:00'), at(3, '11:00:00', { caption: 'Tram 28', inBook: true })],
|
||||
[],
|
||||
{ limit: 2 },
|
||||
);
|
||||
@@ -342,7 +338,10 @@ describe('pickBookPhotos', () => {
|
||||
expect(ids(one)).toEqual([[101]]);
|
||||
expect(one.groups[0]?.dropped).toHaveLength(30);
|
||||
expect(one.groups[0]?.dropped_more).toBe(5);
|
||||
const five = pickBookPhotos([1, 2, 3, 4, 5].flatMap((day) => burst(day, 31)), []);
|
||||
const five = pickBookPhotos(
|
||||
[1, 2, 3, 4, 5].flatMap((day) => burst(day, 31)),
|
||||
[],
|
||||
);
|
||||
expect(bookPhotoSuggestionsSchema.parse(five)).toEqual(five);
|
||||
expect(five.groups.map((g) => [g.dropped.length, g.dropped_more])).toEqual([
|
||||
[30, 0],
|
||||
|
||||
@@ -258,7 +258,10 @@ export function pickBookPhotos(
|
||||
const chosen = filterFor(placed, options, byEntry);
|
||||
const groups = groupByDayAndPlace(chosen);
|
||||
const judged = groups.map((g) => judge(g, purpose, median));
|
||||
const shown = takeRoundRobin(judged.map((j) => j.picks), limit);
|
||||
const shown = takeRoundRobin(
|
||||
judged.map((j) => j.picks),
|
||||
limit,
|
||||
);
|
||||
const out: BookPhotoSuggestions['groups'] = [];
|
||||
let groupsMore = 0;
|
||||
let droppedRoom: number = PHOTO_PICK.droppedTotal;
|
||||
@@ -417,7 +420,7 @@ function similarSets(members: readonly Placed[]): Placed[][] {
|
||||
let r = i;
|
||||
while (parent[r] !== r) r = parent[r] ?? r;
|
||||
// Every index on the way now points straight at the root.
|
||||
for (let k = i; parent[k] !== r; ) {
|
||||
for (let k = i; parent[k] !== r;) {
|
||||
const next = parent[k] ?? r;
|
||||
parent[k] = r;
|
||||
k = next;
|
||||
|
||||
Reference in New Issue
Block a user