mirror of
https://github.com/nasa/openmct.git
synced 2025-06-05 09:00:49 +00:00
[Plot] Update failing specs
Update failing specs for changes related to fixed duration plots, WTD-1273.
This commit is contained in:
parent
e5b0af47e1
commit
d6a31dcef3
@ -81,10 +81,11 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("invokes mctDragDown when dragging begins", function () {
|
it("invokes mctDragDown when dragging begins", function () {
|
||||||
mockElement.on.mostRecentCall.args[1](testEvent(42, 60));
|
var event = testEvent(42, 60);
|
||||||
|
mockElement.on.mostRecentCall.args[1](event);
|
||||||
expect(mockScope.$eval).toHaveBeenCalledWith(
|
expect(mockScope.$eval).toHaveBeenCalledWith(
|
||||||
testAttrs.mctDragDown,
|
testAttrs.mctDragDown,
|
||||||
{ delta: [0, 0] }
|
{ delta: [0, 0], $event: event }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,23 +102,27 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("invokes mctDrag expression during drag", function () {
|
it("invokes mctDrag expression during drag", function () {
|
||||||
|
var event;
|
||||||
|
|
||||||
mockElement.on.mostRecentCall.args[1](testEvent(42, 60));
|
mockElement.on.mostRecentCall.args[1](testEvent(42, 60));
|
||||||
|
|
||||||
// Find and invoke the mousemove listener
|
// Find and invoke the mousemove listener
|
||||||
mockBody.on.calls.forEach(function (call) {
|
mockBody.on.calls.forEach(function (call) {
|
||||||
if (call.args[0] === 'mousemove') {
|
if (call.args[0] === 'mousemove') {
|
||||||
call.args[1](testEvent(52, 200));
|
call.args[1](event = testEvent(52, 200));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Should have passed that delta to mct-drag expression
|
// Should have passed that delta to mct-drag expression
|
||||||
expect(mockScope.$eval).toHaveBeenCalledWith(
|
expect(mockScope.$eval).toHaveBeenCalledWith(
|
||||||
testAttrs.mctDrag,
|
testAttrs.mctDrag,
|
||||||
{ delta: [10, 140] }
|
{ delta: [10, 140], $event: event }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("invokes mctDragUp expression after drag", function () {
|
it("invokes mctDragUp expression after drag", function () {
|
||||||
|
var event;
|
||||||
|
|
||||||
mockElement.on.mostRecentCall.args[1](testEvent(42, 60));
|
mockElement.on.mostRecentCall.args[1](testEvent(42, 60));
|
||||||
|
|
||||||
// Find and invoke the mousemove listener
|
// Find and invoke the mousemove listener
|
||||||
@ -129,7 +134,7 @@ define(
|
|||||||
// Find and invoke the mousemove listener
|
// Find and invoke the mousemove listener
|
||||||
mockBody.on.calls.forEach(function (call) {
|
mockBody.on.calls.forEach(function (call) {
|
||||||
if (call.args[0] === 'mouseup') {
|
if (call.args[0] === 'mouseup') {
|
||||||
call.args[1](testEvent(40, 71));
|
call.args[1](event = testEvent(40, 71));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -138,7 +143,7 @@ define(
|
|||||||
// initial position
|
// initial position
|
||||||
expect(mockScope.$eval).toHaveBeenCalledWith(
|
expect(mockScope.$eval).toHaveBeenCalledWith(
|
||||||
testAttrs.mctDragUp,
|
testAttrs.mctDragUp,
|
||||||
{ delta: [-2, 11] }
|
{ delta: [-2, 11], $event: event }
|
||||||
);
|
);
|
||||||
|
|
||||||
// Should also have unregistered listeners
|
// Should also have unregistered listeners
|
||||||
@ -147,4 +152,4 @@ define(
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -297,7 +297,7 @@ define(
|
|||||||
subPlotBounds = $event.target.getBoundingClientRect();
|
subPlotBounds = $event.target.getBoundingClientRect();
|
||||||
mousePosition = toMousePosition($event);
|
mousePosition = toMousePosition($event);
|
||||||
// Treat any modifier key as a pan
|
// Treat any modifier key as a pan
|
||||||
if (event.altKey || event.shiftKey || event.ctrlKey) {
|
if ($event.altKey || $event.shiftKey || $event.ctrlKey) {
|
||||||
// Start panning
|
// Start panning
|
||||||
panStart = mousePosition;
|
panStart = mousePosition;
|
||||||
panStartBounds = panZoomStack.getPanZoom();
|
panStartBounds = panZoomStack.getPanZoom();
|
||||||
|
@ -127,7 +127,7 @@ define(
|
|||||||
|
|
||||||
// Simulate a marquee zoom. Note that the mockElement
|
// Simulate a marquee zoom. Note that the mockElement
|
||||||
// is 100 by 100 and starts at 10,20
|
// is 100 by 100 and starts at 10,20
|
||||||
subplot.startMarquee({
|
subplot.startDrag({
|
||||||
target: mockElement,
|
target: mockElement,
|
||||||
clientX: 60,
|
clientX: 60,
|
||||||
clientY: 45
|
clientY: 45
|
||||||
@ -137,7 +137,7 @@ define(
|
|||||||
clientX: 75,
|
clientX: 75,
|
||||||
clientY: 85
|
clientY: 85
|
||||||
});
|
});
|
||||||
subplot.endMarquee({
|
subplot.endDrag({
|
||||||
target: mockElement,
|
target: mockElement,
|
||||||
clientX: 80,
|
clientX: 80,
|
||||||
clientY: 95
|
clientY: 95
|
||||||
@ -162,7 +162,7 @@ define(
|
|||||||
|
|
||||||
// Simulate a marquee zoom. Note that the mockElement
|
// Simulate a marquee zoom. Note that the mockElement
|
||||||
// is 100 by 100 and starts at 10,20
|
// is 100 by 100 and starts at 10,20
|
||||||
subplot.startMarquee({
|
subplot.startDrag({
|
||||||
target: mockElement,
|
target: mockElement,
|
||||||
clientX: 60,
|
clientX: 60,
|
||||||
clientY: 45
|
clientY: 45
|
||||||
@ -172,7 +172,7 @@ define(
|
|||||||
clientX: 75,
|
clientX: 75,
|
||||||
clientY: 85
|
clientY: 85
|
||||||
});
|
});
|
||||||
subplot.endMarquee({
|
subplot.endDrag({
|
||||||
target: mockElement,
|
target: mockElement,
|
||||||
clientX: 60,
|
clientX: 60,
|
||||||
clientY: 45
|
clientY: 45
|
||||||
@ -198,4 +198,4 @@ define(
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -83,9 +83,6 @@ define(
|
|||||||
expect(buffer.findInsertionIndex(10)).toEqual(4);
|
expect(buffer.findInsertionIndex(10)).toEqual(4);
|
||||||
expect(buffer.findInsertionIndex(14.5)).toEqual(5);
|
expect(buffer.findInsertionIndex(14.5)).toEqual(5);
|
||||||
expect(buffer.findInsertionIndex(20)).toEqual(6);
|
expect(buffer.findInsertionIndex(20)).toEqual(6);
|
||||||
|
|
||||||
// 9 is already in there, disallow insertion
|
|
||||||
expect(buffer.findInsertionIndex(9)).toEqual(-1);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("allows insertion in the middle", function () {
|
it("allows insertion in the middle", function () {
|
||||||
@ -169,4 +166,4 @@ define(
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user