Skip to content

Commit 9d6f6dd

Browse files
committed
Spec for preventing negative values for Size and Border width
1 parent 766a056 commit 9d6f6dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

public/js/spec/views/arrow_configuration_view_spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ describe("CSSArrowPlease.ArrowConfigurationView", function () {
8787
arrowAttr = object.arrowAttr;
8888

8989
$.each(keystrokes, function (i, keystroke) {
90-
var keydown = $.Event('keydown')
90+
var keydown = $.Event('keydown'),
91+
expectedVal = defaultVal + keystroke.increment;
9192
keydown.keyCode = keystroke.key;
9293
keydown.shiftKey = keystroke.shift;
9394

9495
elem.val(defaultVal).trigger(keydown);
95-
expect( arrow.get(arrowAttr) ).toEqual(defaultVal + keystroke.increment);
96+
97+
if (expectedVal < 0) expectedVal = 0;
98+
expect( arrow.get(arrowAttr) ).toEqual(expectedVal);
9699
});
97100
});
98101
});

0 commit comments

Comments
 (0)