-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
restyle/relayout refactor #1999
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
Changes from 1 commit
4d3e2ec
95d7d71
3326ecc
a948cce
dd52922
f90f079
e036fea
69e0188
bbfe399
29931ec
fad72a2
e895b32
7a7dc6d
c87b01a
658e5cb
f49ae5e
7ea0d25
284c87f
b9826c8
7c38a4a
96cc57f
cb94e95
238e248
42662ba
50aa1ca
62a1392
87b26d5
040ed1b
388a7fe
6e8a68c
4f8fc66
97ddf48
fe7db79
68f5dbc
d15e541
7ec1634
a107466
42805c2
8d9feaf
0a98a6d
e4227aa
0729921
407ae5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
var d3 = require('d3'); | ||
|
||
module.exports = function checkTicks(axLetter, vals, msg) { | ||
var selection = d3.selectAll('.' + axLetter + 'tick text'); | ||
expect(selection.size()).toBe(vals.length); | ||
selection.each(function(d, i) { | ||
expect(d3.select(this).text()).toBe(vals[i], msg + ': ' + i); | ||
}); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Conditionally negate an expectation: | ||
* | ||
* negateIf(expect(x), xIsSomethingElse).toBe(0); | ||
* | ||
* is equivalent to: | ||
* | ||
* if(xIsSomethingElse) expect(x).not.toBe(0); | ||
* else expect(x).toBe(0); | ||
*/ | ||
module.exports = function negateIf(expectation, negate) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking but I wonder if there's a way to rewrite this as a custom jasmine matcher. So that we have something like: expect(x).negateIf(negate).toBe(0) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if(negate) return expectation.not; | ||
return expectation; | ||
}; |
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.
I've been trying to centralized common custom assertions like this one in:
https://github.com/plotly/plotly.js/blob/master/test/jasmine/assets/custom_assertions.js
I'll let decide whether separate files or a common module is better for stuff like this.
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.
oh that's nice - yeah, I'll put
checkTicks
in there.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.
e4227aa