Skip to content

Commit 8dcf567

Browse files
committed
fix: update arrow head computed properties to use 'none' comparison and configure happy-dom test environment settings
1 parent 2ed4cea commit 8dcf567

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

new-deepnotes/apps/web/src/features/spatial/ArrowPropertiesCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const emit = defineEmits({
2424
2525
const bodyType = computed(() => props.arrowModel?.bodyType?.value ?? 'curve')
2626
const bodyStyle = computed(() => props.arrowModel?.bodyStyle?.value ?? 'solid')
27-
const sourceHead = computed(() => props.arrowModel?.sourceHead?.value ?? false)
28-
const targetHead = computed(() => props.arrowModel?.targetHead?.value ?? true)
27+
const sourceHead = computed(() => props.arrowModel?.sourceHead?.value !== 'none')
28+
const targetHead = computed(() => props.arrowModel?.targetHead?.value !== 'none')
2929
const color = computed(() => props.arrowModel?.color?.value ?? 0)
3030
const colorInherit = computed(() => props.arrowModel?.color?.inherit?.value ?? false)
3131
const readOnlyArrow = computed(() => props.arrowModel?.readOnly?.value ?? false)

new-deepnotes/apps/web/src/test/setup.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@ vi.mock("vue-router", async (importOriginal) => {
1717
};
1818
});
1919

20-
// Set up proper HTML doctype for KaTeX
21-
document.documentElement.innerHTML = "<!DOCTYPE html><html><head></head><body></body></html>";
20+
// Suppress KaTeX quirks mode warning (happy-dom doesn't support doctype properly)
21+
const originalWarn = console.warn;
22+
console.warn = (...args) => {
23+
if (typeof args[0] === 'string' && args[0].includes('KaTeX doesn\'t work in quirks mode')) {
24+
return;
25+
}
26+
originalWarn(...args);
27+
};

new-deepnotes/apps/web/vite.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ export default defineConfig({
2727
},
2828
test: {
2929
environment: "happy-dom",
30+
environmentOptions: {
31+
happyDOM: {
32+
settings: {
33+
disableJavaScriptFileLoading: true,
34+
disableCSSFileLoading: true,
35+
disableErrorCapturing: true,
36+
},
37+
},
38+
},
3039
include: ["src/**/*.test.ts"],
3140
setupFiles: ["./src/test/setup.ts"],
3241
testTimeout: 120000,

0 commit comments

Comments
 (0)