Last active
October 26, 2017 14:08
-
-
Save classiemilio/9e572286149020adf17b0f78a0e3cb33 to your computer and use it in GitHub Desktop.
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
const circle = d3.select('circle'); | |
function transition(radius, duration) { | |
circle.transition() | |
.duration(duration) | |
.attr('r', radius); | |
} | |
describe('#transition', () => { | |
beforeEach(() => { | |
D3TestUtils.stubAndForceTransitions(); | |
}); | |
afterEach(() => { | |
D3TestUtils.restoreTransitions(); | |
}); | |
it('correctly transitions circle radius', () => { | |
transition(50, 1000); | |
assert.strictEqual(circle.attr('r'), '50'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment