Skip to content

Commit

Permalink
test: 🧪 update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed Jun 12, 2023
1 parent 7062371 commit 62d482d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/unit/helpers/data.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { reactive, ref } from 'vue';

let id = 0;
const curYear = new Date().getFullYear();
const curMonth = new Date().getMonth();

const ganttData = reactive<any>([]);

function onAdd() {
ganttData.push({
index: ++id,
name: 't' + id,
startDate: new Date(2023, 4, id),
endDate: new Date(2023, 5, id + 5),
startDate: new Date(curYear, curMonth, id),
endDate: new Date(curYear, curMonth + 1, id + 5),
o: { t1: 'a', t2: 'b' }
});
}
Expand All @@ -22,24 +24,24 @@ ganttData[0].children = [
{
index: ++id,
name: 'sub-t' + id,
startDate: new Date(2023, 3, 5),
endDate: new Date(2023, 3, 10),
startDate: new Date(curYear, curMonth, 5),
endDate: new Date(curYear, curMonth, 10),
progress: 0.8,
o: { t1: 'a', t2: 'b' }
},
{
index: ++id,
name: 'sub-t' + id,
startDate: new Date(2023, 3, 6),
endDate: new Date(2023, 3, 10),
startDate: new Date(curYear, curMonth, 6),
endDate: new Date(curYear, curMonth, 10),
progress: 0.5,
o: { t1: 'a', t2: 'b' },
children: [
{
index: ++id,
name: 'sub-sub-t' + id,
startDate: new Date(2023, 3, 5),
endDate: new Date(2023, 3, 10),
startDate: new Date(curYear, curMonth, 5),
endDate: new Date(curYear, curMonth, 10),
progress: 0.3333333333,
o: { t1: 'a', t2: 'b' }
}
Expand Down

0 comments on commit 62d482d

Please sign in to comment.