Эх сурвалжийг харах

unittest Coordinates. min is positive

Ievgen Naida 5 жил өмнө
parent
commit
2106a6dc24

+ 13 - 0
tests/js/timelineTests.js

@@ -408,6 +408,19 @@ describe('Timeline', function () {
             chai.expect(timeline.pxToVal(75)).equal(50);
             chai.expect(timeline.pxToVal(100)).equal(100);
         });
+        it('Coordinates. min is positive', function () {
+            var timeline = new animation_timeline_1.Timeline();
+            timeline._setOptions({
+                stepVal: 100,
+                stepPx: 50,
+                min: 100,
+                zoom: 1,
+            });
+            chai.expect(timeline.valToPx(100)).equal(0);
+            chai.expect(timeline.valToPx(150)).equal(25);
+            chai.expect(timeline.pxToVal(0)).equal(100);
+            chai.expect(timeline.pxToVal(25)).equal(150);
+        });
         it('Zoom is respected', function () {
             var timeline = new animation_timeline_1.Timeline();
             timeline._setOptions({

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
tests/js/timelineTests.js.map


+ 15 - 0
tests/timelineTests.ts

@@ -433,6 +433,21 @@ describe('Timeline', function () {
       chai.expect(timeline.pxToVal(75)).equal(50);
       chai.expect(timeline.pxToVal(100)).equal(100);
     });
+    it('Coordinates. min is positive', function () {
+      const timeline = new Timeline();
+      timeline._setOptions({
+        stepVal: 100,
+        stepPx: 50,
+        min: 100,
+        zoom: 1,
+      } as TimelineOptions);
+
+      chai.expect(timeline.valToPx(100)).equal(0);
+      chai.expect(timeline.valToPx(150)).equal(25);
+
+      chai.expect(timeline.pxToVal(0)).equal(100);
+      chai.expect(timeline.pxToVal(25)).equal(150);
+    });
     it('Zoom is respected', function () {
       const timeline = new Timeline();
       timeline._setOptions({

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно