This repository was archived by the owner on Dec 8, 2022. It is now read-only.
feat: support using natural jasmine syntax when comp is not found#29
Open
Blackbaud-ColbyWhite wants to merge 1 commit intoblackbaud:masterfrom
Open
feat: support using natural jasmine syntax when comp is not found#29Blackbaud-ColbyWhite wants to merge 1 commit intoblackbaud:masterfrom
Blackbaud-ColbyWhite wants to merge 1 commit intoblackbaud:masterfrom
Conversation
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Take the following case.
if you want to write a test for the scenario when the
sky-alertshould not show up in the DOM, the previous strategy meant you had to write a test like such.this doesn't read very well. the case you're trying to test doesn't relate to errors, yet the way you have to write your assertion involves knowing about an error getting thrown. a more preferred way to assert this would be the following:
this reads more explicitly as to what you're trying to assert in the test.
this PR restructures the component selector in order to allow for this type of assertion by returning
undefinedin the scenario where the component isn't found. this mimics how you would do assertions for regular DOM elements (i.e.expect(fixture.query('h1')).not.toExist())) in similar scenarios.the downside is that the way i've written this, i'm pretty sure it would be a breaking change. so if there are any ideas as to how to move to the new behavior in a non-breaking fashion, i'm all ears. i was a bit stumped on that point.