-
Notifications
You must be signed in to change notification settings - Fork 123
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
Warn user when includesText
assertion should expect collapsable whitespace
#198
Conversation
Three tests are added. The first two may not be desirable specifications, since passing them might cause a major version bump again. The third test is an example of a possible scenario to mitigage confusion. That would be my suggestion if passing the first two is too much of a burden. Or something like that.
This is my suggestion for addressing issue mainmatter#197.
I'm not sure what the issue is here. If your issue is that you would like to do a |
Yes. That is another option that I had considering and of course forgot to mention. This PR does add a message for the user, but I am not sure if this is the best way. Or should it throw and error with a message in there, because bad input was supplied as the expected test?
I’ll remove the two tests I figured that were not going to be the path forward.
… On Nov 16, 2018, at 2:12 AM, Tobias Bieniek ***@***.***> wrote:
I'm not sure what the issue is here. hasText() and includesText() should behave similarly in general and also with regard to whitespace collapsing. I agree though, that it might make sense to print a warning somewhere if the input string contains whitespace that would be collapsed 🤔
If your issue is that you would like to do a has/includesText() assertion without the automatic collapsing then maybe it would make sense to introduce a collapseWhitespace: false option on those assertions.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think we should probably just use |
Great. I think the assertions you have will work just fine. Just that helpful messaging will be sufficient. I'll do some further tests with changes in an Ember environment, then adjust this PR. |
includesText
assertion should expect collapsable whitespace
I have also updated the API docs to contain a warning to the same effect. Just lets users know that whitespace is collapsed in this assertion. |
I guess the same warning should be added to the
yeah, I think that would be better |
Should be all set, @Turbo87. FYI, the warning message reads as follows:
(Then it reproduces the user's text on the next line.) |
thanks :) |
I added three tests. The first two may not be desirable specifications, since passing them might cause a major version bump again. (They test that text containing expected line breaks, etc, would pass.)
The third test is an example of a possible scenario to mitigate confusion described in #197. That would be my suggestion if passing the first two is too much of a burden. Or something like that.