From b4a6ec8d451c391a5c5bb8b67b032f640babac42 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 04 十一月 2022 15:41:10 +0800
Subject: [PATCH] 1.自动排程功能进行代码研究
---
src/lib/v-gantt-chart/test/gtUtils.test.js | 66 +++++++++++++++++----------------
1 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/src/lib/v-gantt-chart/test/gtUtils.test.js b/src/lib/v-gantt-chart/test/gtUtils.test.js
index 0a1af6f..d1e80ce 100644
--- a/src/lib/v-gantt-chart/test/gtUtils.test.js
+++ b/src/lib/v-gantt-chart/test/gtUtils.test.js
@@ -1,101 +1,103 @@
-var expect = require('chai').expect
+var expect = require('chai').expect;
var func = require('../lib/utils/gtUtils')
import dayjs from 'dayjs'
describe('娴嬭瘯gtUtils.js', function() {
+
describe('娴嬭瘯getWidthAbout2Times鍑芥暟', function() {
it('鐩稿悓鏃堕棿 璁$畻缁撴灉涓�0', function() {
expect(func.getWidthAbout2Times(dayjs(
- '2018-10-10 10:00:00'), dayjs(
+ '2018-10-10 10:00:00'), dayjs(
'2018-10-10 10:00:00'), {
- scale: 60,
- cellWidth: 60
- }))
- .to.be.equal(0)
- })
+ scale: 60,
+ cellWidth: 60
+ }))
+ .to.be.equal(0);
+ });
it('鏁版嵁娴嬭瘯1', function() {
expect(func.getWidthAbout2Times(dayjs(
'2018-10-10 10:00:00'), dayjs(
- '2018-10-10 11:00:00'), {
+ '2018-10-10 11:00:00'), {
scale: 60,
cellWidth: 60
})).to.equal(60)
- })
+ });
it('鏁版嵁娴嬭瘯2', function() {
expect(func.getWidthAbout2Times(dayjs(
'2018-10-10 00:00:00'), dayjs(
- '2018-10-10 01:10:00'), {
+ '2018-10-10 01:10:00'), {
scale: 1,
cellWidth: 1
})).to.equal(70)
- })
+ });
it('鏁版嵁娴嬭瘯3', function() {
expect(func.getWidthAbout2Times(dayjs(
'2018-10-11 10:00:00'), dayjs(
- '2018-10-11 00:00:00'), {
+ '2018-10-11 00:00:00'), {
scale: 10,
cellWidth: 10
})).to.equal(-600)
- })
+ });
it('鏁版嵁娴嬭瘯4', function() {
expect(func.getWidthAbout2Times(dayjs(
'2018-10-10 00:00:00'), dayjs(
- '2018-10-10 10:00:00'), {
+ '2018-10-10 10:00:00'), {
scale: 10,
cellWidth: 60
})).to.equal(3600)
- })
- })
+ });
+ });
describe('娴嬭瘯getPositonOffset鍑芥暟', function() {
it('鐩稿悓鏃堕棿 璁$畻缁撴灉涓�0', function() {
expect(func.getPositonOffset(dayjs(
- '2018-10-10 10:00:00'), dayjs(
+ '2018-10-10 10:00:00'), dayjs(
'2018-10-10 10:00:00'), {
- scale: 60,
- cellWidth: 60
- }))
- .to.be.equal(0)
- })
+ scale: 60,
+ cellWidth: 60
+ }))
+ .to.be.equal(0);
+ });
it('鏁版嵁娴嬭瘯1', function() {
expect(func.getPositonOffset(dayjs(
'2018-10-10 10:00:00'), dayjs(
- '2018-10-10 11:00:00'), {
+ '2018-10-10 11:00:00'), {
scale: 60,
cellWidth: 60
})).to.equal(-60)
- })
+ });
it('鏁版嵁娴嬭瘯2', function() {
expect(func.getPositonOffset(dayjs(
'2018-10-10 00:00:00'), dayjs(
- '2018-10-10 01:10:00'), {
+ '2018-10-10 01:10:00'), {
scale: 60,
cellWidth: 60
})).to.equal(-70)
- })
+ });
it('鏁版嵁娴嬭瘯3', function() {
expect(func.getPositonOffset(dayjs(
'2018-10-11 10:00:00'), dayjs(
- '2018-10-11 00:00:00'), {
+ '2018-10-11 00:00:00'), {
scale: 60,
cellWidth: 60
})).to.equal(+600)
- })
+ });
it('鏁版嵁娴嬭瘯4', function() {
expect(func.getPositonOffset(dayjs(
'2018-10-10 00:00:00'), dayjs(
- '2018-10-10 10:00:00'), {
+ '2018-10-10 10:00:00'), {
scale: 60,
cellWidth: 60
})).to.equal(-600)
- })
- })
-})
+ });
+ });
+
+});
\ No newline at end of file
--
Gitblit v1.9.3