-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
madhuredra
committed
Sep 23, 2023
1 parent
a226b1e
commit 8e8280c
Showing
4 changed files
with
24 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import Shape from '../Shape' | ||
describe('Shape', () => { | ||
it('should have correct initial position', () => { | ||
const myShape = new Shape(10, 20); | ||
expect(myShape.getX()).toBe(10); | ||
expect(myShape.getY()).toBe(20); | ||
}); | ||
const myShape = new Shape(10, 20) | ||
expect(myShape.getX()).toBe(10) | ||
expect(myShape.getY()).toBe(20) | ||
}) | ||
|
||
it('should be able to move and update position', () => { | ||
const myShape = new Shape(10, 20); | ||
myShape.move(30, 40); | ||
expect(myShape.getX()).toBe(30); | ||
expect(myShape.getY()).toBe(40); | ||
}); | ||
const myShape = new Shape(10, 20) | ||
myShape.move(30, 40) | ||
expect(myShape.getX()).toBe(30) | ||
expect(myShape.getY()).toBe(40) | ||
}) | ||
|
||
it('should create another shape with the correct initial position', () => { | ||
const anotherShape = new Shape(5, 8); | ||
expect(anotherShape.getX()).toBe(5); | ||
expect(anotherShape.getY()).toBe(8); | ||
}); | ||
const anotherShape = new Shape(5, 8) | ||
expect(anotherShape.getX()).toBe(5) | ||
expect(anotherShape.getY()).toBe(8) | ||
}) | ||
|
||
it('should be able to move another shape and update position', () => { | ||
const anotherShape = new Shape(5, 8); | ||
anotherShape.move(15, 25); | ||
expect(anotherShape.getX()).toBe(15); | ||
expect(anotherShape.getY()).toBe(25); | ||
}); | ||
}); | ||
const anotherShape = new Shape(5, 8) | ||
anotherShape.move(15, 25) | ||
expect(anotherShape.getX()).toBe(15) | ||
expect(anotherShape.getY()).toBe(25) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.