Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified tests/__snapshots__/reference-text-core-canvas.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 2 additions & 17 deletions tests/reference-text-core-canvas.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const BOARD_WIDTH_MM = 30
const BOARD_HEIGHT_MM = 18
const CANVAS_WIDTH_PX = 1200
const CANVAS_HEIGHT_PX = 720
const PREVIOUS_FOOTPRINTER_REFERENCE_FONT_SIZE_MM = 0.2

function getPreviewFootprintCircuitJson(footprintName: string) {
switch (footprintName) {
Expand Down Expand Up @@ -37,28 +36,14 @@ function getPreviewFootprintCircuitJson(footprintName: string) {
throw new Error(`Unknown preview footprint: ${footprintName}`)
}

function getPreviousPreviewFootprintCircuitJson(footprintName: string) {
return getPreviewFootprintCircuitJson(footprintName).map((element) => {
if (element.type !== "pcb_silkscreen_text") {
return element
}

return {
...element,
font_size: PREVIOUS_FOOTPRINTER_REFERENCE_FONT_SIZE_MM,
}
})
}

test("render 0.4mm reference text through Core and circuit-to-canvas", async () => {
test("render 0.6mm reference text through Core and circuit-to-canvas", async () => {
const circuit = new Circuit({
platform: {
schematicDisabled: true,
routingDisabled: true,
footprintLibraryMap: {
preview: async (footprintName) => ({
footprintCircuitJson:
getPreviousPreviewFootprintCircuitJson(footprintName),
footprintCircuitJson: getPreviewFootprintCircuitJson(footprintName),
}),
},
},
Expand Down
Loading