-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor drag box layer tests - Part 1 #2655
Conversation
let bounds = dbl.bounds(); | ||
assert.deepEqual(bounds.topLeft, startPoint, "top-left point was set correctly"); | ||
assert.deepEqual(bounds.bottomRight, endPoint, "bottom-right point was set correctly"); | ||
describe("DragBoxLayer - basics", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a better description?
let target = dbl.background(); | ||
TestMethods.triggerFakeDragSequence(target, targetPoint, targetPoint); | ||
afterEach(() => { | ||
svg.remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will get called even the test fails; I remember being told that this is not desired
just wondering, is it necessary to put |
Amazing review. Thank you very much. Managed to apply suggestions from here to my other refactor PRs. |
|
||
it("can get and set the detection radius", () => { | ||
assert.strictEqual(dbl.detectionRadius(), 3, "there is a default detection radius"); | ||
assert.doesNotThrow(() => dbl.detectionRadius(4), Error, "can set detection radius before anchoring"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cannot set detection..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesNotThrow()
. I got tricked by this 3 times while refactoring. The signature is a bit weird.
…ame component on all drag events
Refactor drag box layer tests - Part 1
Part of #2623
I will be doing multiple passes because I will get more context (and better sense of best practices) by refactoring other files. However, please flag anything that seems unusual.
As part of this:
beforeEach()
clausesbeforeEach()
esafterEach()
to save some LOCs[NOQE] as no JS changes