-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat: add factory for SpectatorForDirective #157
Conversation
const createHost = createHostDirectiveFactory(HighlightDirective); | ||
|
||
// calculated styles not supported in JSDOM | ||
xit('should change the background color', () => { |
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.
remove xit
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.
Oh, I removed it but the tests fail. I had to exclude these tests earlier because the toHaveStyle()
matcher is not supported in Jest. It relies on getComputedStyle().getPropertyValue()
.
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.
There is a way to check if the user uses Jest and warn them that it will not work?
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.
We currently don't have a way to detect it. Let's see if another solution is possible, e.g. not relying on computed styles. Let's fix it in a separate PR.
5108cfe
to
0ff4455
Compare
0ff4455
to
ef885d6
Compare
So what I basically did:
Spectator
to abstractDomSpectator
(for querying, event dispatching, etc) in order to reuse itSpectatorForDirective
which contains stuff from bothSpectator
andSpectatorWithHost
component
this one has adirective
instance