aboutsummaryrefslogtreecommitdiff
path: root/src/components/BaseLine.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-12-18 20:26:07 +1100
committerTerry Truong <terry06890@gmail.com>2022-12-18 20:26:07 +1100
commitfac881d61176f04a4062db710df98924a76b0ffb (patch)
tree6c55c0f100668888a31dc54daa24d9d794bdba76 /src/components/BaseLine.vue
parent83366605d1bd43c245c4c110fadfd1a6fd05d3c2 (diff)
Add unit testing
Install vitest, happy-dom, and @testing-library/vue Add lib.ts and rbtree.ts tests in tests/ Modularise some date-range-managing code from App.vue into lib.ts
Diffstat (limited to 'src/components/BaseLine.vue')
-rw-r--r--src/components/BaseLine.vue4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/BaseLine.vue b/src/components/BaseLine.vue
index 33d8a88..0187b20 100644
--- a/src/components/BaseLine.vue
+++ b/src/components/BaseLine.vue
@@ -43,7 +43,7 @@ const periods: Ref<Period[]> = ref([
const skipTransition = ref(true);
onMounted(() => setTimeout(() => {skipTransition.value = false}, 100));
-// For size tracking (used to prevent time spans shrinking below 1 pixel)
+// For size and mount-status tracking
const width = ref(0);
const height = ref(0);
const mounted = ref(false);
@@ -87,7 +87,7 @@ function spanStyles(state: TimelineState){
let start = state.startDate.clone();
let end = state.endDate.clone();
let scale = SCALES[state.scaleIdx];
- if (scale != MONTH_SCALE && scale != DAY_SCALE){ // Possibly incorporate offsets
+ if (scale != MONTH_SCALE && scale != DAY_SCALE){ // Account for offsets
stepDate(start, 1, {forward: false, count: Math.floor(state.startOffset * scale), inplace: true});
stepDate(end, 1, {count: Math.floor(state.endOffset * scale), inplace: true});
}