-
Notifications
You must be signed in to change notification settings - Fork 33
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
[TEST] Update error message in e2e tests #689
Conversation
766171d
to
58f70c7
Compare
test/e2e/mxGraph.model.test.ts
Outdated
const cell = bpmnVisualization.graph.model.getCell(cellId); | ||
if (cell) { | ||
return { | ||
message: () => `Expected cell with id '${cellId}' NOT to be defined`, |
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.
❓ if this more accurate, I guess that when the expect pass, we have to provide what is ok
message: () => `Expected cell with id '${cellId}' NOT to be defined`, | |
message: () => `Expected cell with id '${cellId}' exists in the mxGraph model`, |
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.
The message must be negative. See the Jest exemple: https://jestjs.io/docs/en/expect#expectextendmatchers
I run the test with a error, and the right message is displayed.
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.
Fair enough, I hadn't found the Jest expect convention.
The Jest doc is clear about that and the new messages are fine.
test/e2e/mxGraph.model.test.ts
Outdated
}; | ||
} else { | ||
return { | ||
message: () => `Expected cell with id '${cellId}' to be defined`, |
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.
message: () => `Expected cell with id '${cellId}' to be defined`, | |
message: () => `Expected cell with id '${cellId}' not found in the mxGraph model`, |
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.
The message must be positive.
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.
Work as expected, minor changes in the expect messages could be done
The messages are updated. But, the expectations are good as they are. |
Ensure we call the expect 'toBeCell' function for better feedbacks on test failure
ccd7291
to
8220ad6
Compare
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.
Ok, with the new messages
Add custom message when a cell is not defined
Closes #672