Skip to content

Commit

Permalink
style(test): reformat ContextPad spec
Browse files Browse the repository at this point in the history
* max line length
* spacing between specs
  • Loading branch information
nikku committed Oct 8, 2018
1 parent 66c5bd0 commit 5977633
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/spec/features/context-pad/ContextPadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,12 @@ describe('features/context-pad', function() {
it('should handle drag event', inject(function(canvas, contextPad) {

// given
var shape = canvas.addShape({ id: 's1', width: 100, height: 100, x: 10, y: 10, type: 'drag' });
var shape = canvas.addShape({
id: 's1',
width: 100, height: 100,
x: 10, y: 10,
type: 'drag'
});

contextPad.open(shape);

Expand All @@ -368,7 +373,9 @@ describe('features/context-pad', function() {

});


describe('scaling', function() {

beforeEach(bootstrapDiagram({ modules: [ contextPadModule, providerModule ] }));

var NUM_REGEX = /[+-]?\d*[.]?\d+(?=,|\))/g;
Expand All @@ -392,7 +399,12 @@ describe('features/context-pad', function() {
function verifyScale(expectedScales) {
return inject(function(canvas, contextPad) {
// given
var shape = canvas.addShape({ id: 's1', width: 100, height: 100, x: 10, y: 10, type: 'drag' });
var shape = canvas.addShape({
id: 's1',
width: 100, height: 100,
x: 10, y: 10,
type: 'drag'
});

contextPad.open(shape);

Expand All @@ -419,6 +431,7 @@ describe('features/context-pad', function() {
});
}


it('should scale within the limits of [ 1.0, 1.5 ] by default', function() {
var expectedScales = [ 1.0, 1.2, 1.5, 1.5, 1.0 ];

Expand All @@ -429,6 +442,7 @@ describe('features/context-pad', function() {
return verifyScale(expectedScales);
});


it('should scale within the limits set in config', function() {
var config = {
scale: {
Expand All @@ -446,6 +460,7 @@ describe('features/context-pad', function() {
return verifyScale(expectedScales);
});


it('should scale with scale = true', function() {
var config = {
scale: false
Expand All @@ -460,6 +475,7 @@ describe('features/context-pad', function() {
return verifyScale(expectedScales);
});


it('should not scale with scale = false', function() {
var config = {
scale: false
Expand All @@ -473,5 +489,7 @@ describe('features/context-pad', function() {

return verifyScale(expectedScales);
});

});

});

0 comments on commit 5977633

Please sign in to comment.