Improve IK-style artifact scanner pipeline
This commit is contained in:
@@ -42,7 +42,7 @@ describe("automationPlanner", () => {
|
||||
});
|
||||
|
||||
it("plans overlapping inventory pages like Inventory Kamera for a partial final page", () => {
|
||||
const targets = Array.from({ length: 40 }, (_, index) => ({
|
||||
const targets = Array.from({ length: 32 }, (_, index) => ({
|
||||
row: Math.floor(index / 8),
|
||||
col: index % 8,
|
||||
x: index * 10,
|
||||
@@ -52,31 +52,31 @@ describe("automationPlanner", () => {
|
||||
const firstPage = buildInventoryPagePlan({
|
||||
targets,
|
||||
cols: 8,
|
||||
rows: 5,
|
||||
totalTargetCount: 50,
|
||||
rows: 4,
|
||||
totalTargetCount: 45,
|
||||
processedTargets: 0,
|
||||
rowsQueued: 0,
|
||||
});
|
||||
expect(firstPage.pageTargets).toHaveLength(40);
|
||||
expect(firstPage.pageTargets).toHaveLength(32);
|
||||
expect(firstPage.startIndex).toBe(0);
|
||||
expect(firstPage.scrollRowsAfterPage).toBe(2);
|
||||
|
||||
const finalPage = buildInventoryPagePlan({
|
||||
targets,
|
||||
cols: 8,
|
||||
rows: 5,
|
||||
totalTargetCount: 50,
|
||||
processedTargets: 40,
|
||||
rowsQueued: 5,
|
||||
rows: 4,
|
||||
totalTargetCount: 45,
|
||||
processedTargets: 32,
|
||||
rowsQueued: 4,
|
||||
});
|
||||
expect(finalPage.pageTargets).toHaveLength(10);
|
||||
expect(finalPage.startIndex).toBe(24);
|
||||
expect(finalPage.pageTargets[0]).toMatchObject({ row: 3, col: 0 });
|
||||
expect(finalPage.pageTargets).toHaveLength(13);
|
||||
expect(finalPage.startIndex).toBe(16);
|
||||
expect(finalPage.pageTargets[0]).toMatchObject({ row: 2, col: 0 });
|
||||
expect(finalPage.scrollRowsAfterPage).toBe(0);
|
||||
});
|
||||
|
||||
it("keeps the first page top-aligned when the whole inventory fits inside one visible page", () => {
|
||||
const targets = Array.from({ length: 40 }, (_, index) => ({
|
||||
const targets = Array.from({ length: 32 }, (_, index) => ({
|
||||
row: Math.floor(index / 8),
|
||||
col: index % 8,
|
||||
x: index * 10,
|
||||
@@ -86,7 +86,7 @@ describe("automationPlanner", () => {
|
||||
const singlePage = buildInventoryPagePlan({
|
||||
targets,
|
||||
cols: 8,
|
||||
rows: 5,
|
||||
rows: 4,
|
||||
totalTargetCount: 16,
|
||||
processedTargets: 0,
|
||||
rowsQueued: 0,
|
||||
|
||||
Reference in New Issue
Block a user