Prefer arrow functions (#2344)

This commit is contained in:
Lipis 2020-11-06 22:06:39 +02:00 committed by GitHub
parent e05acd6fd9
commit a20f3240fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 304 additions and 336 deletions

View file

@ -29,7 +29,7 @@ beforeEach(async () => {
render(<App />);
});
function createAndSelectTwoRectangles() {
const createAndSelectTwoRectangles = () => {
UI.clickTool("rectangle");
mouse.down();
mouse.up(100, 100);
@ -44,9 +44,9 @@ function createAndSelectTwoRectangles() {
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.click();
});
}
};
function createAndSelectTwoRectanglesWithDifferentSizes() {
const createAndSelectTwoRectanglesWithDifferentSizes = () => {
UI.clickTool("rectangle");
mouse.down();
mouse.up(100, 100);
@ -61,7 +61,7 @@ function createAndSelectTwoRectanglesWithDifferentSizes() {
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.click();
});
}
};
it("aligns two objects correctly to the top", () => {
createAndSelectTwoRectangles();
@ -185,7 +185,7 @@ it("centers two objects with different sizes correctly horizontally", () => {
expect(API.getSelectedElements()[1].y).toEqual(110);
});
function createAndSelectGroupAndRectangle() {
const createAndSelectGroupAndRectangle = () => {
UI.clickTool("rectangle");
mouse.down();
mouse.up(100, 100);
@ -213,7 +213,7 @@ function createAndSelectGroupAndRectangle() {
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.click();
});
}
};
it("aligns a group with another element correctly to the top", () => {
createAndSelectGroupAndRectangle();
@ -299,7 +299,7 @@ it("centers a group with another element correctly horizontally", () => {
expect(API.getSelectedElements()[2].x).toEqual(100);
});
function createAndSelectTwoGroups() {
const createAndSelectTwoGroups = () => {
UI.clickTool("rectangle");
mouse.down();
mouse.up(100, 100);
@ -339,7 +339,7 @@ function createAndSelectTwoGroups() {
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.click();
});
}
};
it("aligns two groups correctly to the top", () => {
createAndSelectTwoGroups();
@ -437,7 +437,7 @@ it("centers two groups correctly horizontally", () => {
expect(API.getSelectedElements()[3].x).toEqual(200);
});
function createAndSelectNestedGroupAndRectangle() {
const createAndSelectNestedGroupAndRectangle = () => {
UI.clickTool("rectangle");
mouse.down();
mouse.up(100, 100);
@ -480,7 +480,7 @@ function createAndSelectNestedGroupAndRectangle() {
Keyboard.withModifierKeys({ shift: true }, () => {
mouse.click();
});
}
};
it("aligns nested group and other element correctly to the top", () => {
createAndSelectNestedGroupAndRectangle();