... are structured into given, (assume), when and then.
What do I actually assume to be already working / what needs to be set up?
(Optional) I assume this setup for my tests to work.
Time to execute something!
Assert that stuff you executed actually works as expected.
You are probably doing it wrong. Tests should be concise, self contained and focused.
Try to write multiple test cases for each when/then block.
What about using something like this as your test template?
// given
var x = 10;
// when
var y = 10 + x;
// then
expect(y).to.eql(20);Ensure you only document the necessary - more content is not better. If needed, add an additional comment above an assertion to document things.
// given
var element = ...;
var parent = element.parent;
// when
moveElement(element, { x: 300 });
// then
// element moved out of parent, must have a new parent now
expect(element.parent).not.to.eql(parent);