Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

test: cover util files #90

Merged
merged 12 commits into from
Feb 21, 2020
Merged

test: cover util files #90

merged 12 commits into from
Feb 21, 2020

Conversation

haxxmaxx
Copy link
Collaborator

@haxxmaxx haxxmaxx commented Feb 19, 2020

Pausing here so this wont get too big.
Todo in next PR:

  • tooltips
  • transform
  • the async stuff in tree-utils
  • some cases in position

render and index are so much d3 and nebula so they are overkill to mock IMO.

@niekvanstaveren
Copy link
Collaborator

Doing a great job here @haxxmaxx, but can we have it in multiple PR's so it will be easier to check?

@haxxmaxx haxxmaxx marked this pull request as ready for review February 20, 2020 13:27
@haxxmaxx haxxmaxx changed the title test: card test: cover util files Feb 20, 2020
@@ -10,7 +10,7 @@ export default {
if (node.data.isLocked) {
return;
}
if (!selections.api.isActive() || !selectionState) {
if (!selections.api.isActive() || !selectionState) { // selectioState !== [] ?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Caele Are we suppose to check if selectionState is emtpy?

Copy link
Collaborator

@niekvanstaveren niekvanstaveren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will have some merge conflicts with the changes on the zooming though

select(node, selectionObj, selectionState);
expect(selectionObj.setState).to.not.have.been.called;
});
it('should early return if elemNo is negative', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different test case

select(node, selectionObj, selectionState);
expect(selectionObj.setState).to.not.have.been.called;
});
it('should call begin sand setState to node id', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

it('should add a warning for max data', () => {
const matrix = [[{ qText: '007', qElemNumber: 0 }, { qText: '-' }]];
const node = createNodes(matrix, [], 'max-data-limit', null, translator);
expect(node.warn).to.eql(['Object.OrgChart.MaxData']);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this function work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equal is equivalent to ===, which would return false, since it is not the same instance of the array. So eql checks the contents instead, kind of... https://stackoverflow.com/questions/36798993/what-is-the-difference-between-equal-and-eql-in-chai-library

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice, I have been using deep equal I think :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very similar, didn't really understand the difference when I read about it

@haxxmaxx
Copy link
Collaborator Author

This will have some merge conflicts with the changes on the zooming though

Yeah I think that's good. After this coverage push, we should try to update the tests to our own changes 😉

@niekvanstaveren
Copy link
Collaborator

This will have some merge conflicts with the changes on the zooming though

Yeah I think that's good. After this coverage push, we should try to update the tests to our own changes 😉

Hard to disagree with that

@haxxmaxx haxxmaxx merged commit 6d3e9e9 into master Feb 21, 2020
@haxxmaxx haxxmaxx deleted the crl/test-coverage branch February 21, 2020 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants