-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
docs: fix BannerComponent
unit tests
#42336
Conversation
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.
@swseverance thanks for the fixing this, the change looks good to me (just one minor comment) 👍
I'm also adding @petebacondarwin as a reviewer since he may have more context on this.
// #docregion setup-may-fail | ||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [BannerComponent], |
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.
It looks like the formatting in these files leave a space in front and right after a symbol, so I believe this should look like:
declarations: [BannerComponent], | |
declarations: [ BannerComponent ], |
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.
@AndrewKushnir thanks for taking a look. Within banner-external.component.spec.ts
there are a total of three declarations: [BannerComponent]
statements (only one of which I introduced in this PR). Would you like me to change all three to declarations: [ BannerComponent ]
?
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.
Within banner-external.component.spec.ts there are a total of three declarations: [BannerComponent] statements (only one of which I introduced in this PR). Would you like me to change all three to declarations: [ BannerComponent ]?
Thanks for the comment. Let's keep it as is for now and see what @petebacondarwin suggests.
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 formatting of the examples is a bit ad hoc since we have not, so far, chosen or enforced a specific formatter tool.
Until we do that, we should try to keep the formatting consistent within guides. The arrays in the the banner.component.spec.ts
file contain spaces around the element, therefore I think that @AndrewKushnir is correct here. Please can you update all the declarations in this file to match.
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.
@petebacondarwin I made the suggested changes. thanks!
You can preview 8ab5366 at https://pr42336-8ab5366.ngbuilds.io/. |
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.
Thanks for this update @swseverance - I am approving subject to making the change to the declarations
array formatting.
Also while you are here, I note that this example code:
// #docregion async-before-each
beforeEach(async () => {
TestBed
.configureTestingModule({
declarations: [BannerComponent],
})
.compileComponents(); // compile template and css
});
// #enddocregion async-before-each
should probably have an await
in front of the call to TestBed.configureTestingModule(...).compileComponents()
, right? Perhaps you could fix that in an extra commit in this PR?
remove `async` and `await` from `BannerComponent` test because the component uses an inline template and styles create doc region in `banner-external.component.spec.ts` demonstrating test setup that may fail due to a missing call to `.compileComponents()` for a component with an external template and stylesheet
You can preview 978f3b1 at https://pr42336-978f3b1.ngbuilds.io/. |
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.
@swseverance thanks for applying the changes to make the code more consistent 👍
remove `async` and `await` from `BannerComponent` test because the component uses an inline template and styles create doc region in `banner-external.component.spec.ts` demonstrating test setup that may fail due to a missing call to `.compileComponents()` for a component with an external template and stylesheet PR Close #42336
remove `async` and `await` from `BannerComponent` test because the component uses an inline template and styles create doc region in `banner-external.component.spec.ts` demonstrating test setup that may fail due to a missing call to `.compileComponents()` for a component with an external template and stylesheet PR Close angular#42336
remove `async` and `await` from `BannerComponent` test because the component uses an inline template and styles create doc region in `banner-external.component.spec.ts` demonstrating test setup that may fail due to a missing call to `.compileComponents()` for a component with an external template and stylesheet PR Close angular#42336
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
remove
async
andawait
fromBannerComponent
test because thecomponent uses an inline template and styles
create new region in
banner-external.component.spec.ts
demonstratingtest setup that may fail due to a missing call to
.compileComponents()
for a component with an external template and stylesheet
resolves #42325
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #42325
What is the new behavior?
Does this PR introduce a breaking change?
Other information