Skip to content
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(accordion): added Card Bootstrap Color Options #431

Closed

Conversation

sendilkumarn
Copy link
Contributor

Before submitting a pull request, please make sure you have at least performed the following:

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated any applicable tests.
  • added/updated any applicable API documentation.
  • added/updated any applicable demos.

fixes #420

@@ -271,15 +272,34 @@ describe('ngb-accordion', () => {
expectOpenPanels(fixture.nativeElement, [false, false, false]);
});
})));

it('should override the type in accordion with type in panel', async(inject([TestComponentBuilder], (tcb) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very light on tests.... We need some more:

  • what happens if no type is specified? (No binding to [type] on accordion / panel)?
  • what happens if type is specified only on accordion level and no panel has type?

I know that those might sound like trivial cases but we need to have them covered.

BTW: you don't have to re-use the same html in each and every test, feel free to have test-specific markup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: you don't have to re-use the same html in each and every test, feel free to have test-specific markup.

you caught me here. I will update now.

@@ -88,7 +95,8 @@ export interface NgbPanelChangeEvent {
</div>
`
})
export class NgbAccordion implements AfterContentChecked {
export class NgbAccordion implements AfterContentChecked,
OnInit {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have OnInit imported and used in implements here? I don't see it being used (I would expect TS to complain in this case...)

let el = fixture.nativeElement.querySelectorAll('.card-header');
expect(el[0]).toHaveCssClass('card-primary');
expect(el[1]).toHaveCssClass('card-primary');
expect(el[2]).toHaveCssClass('card-primary');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct! We shouldn't get any class other than card-header (and eventually active) by default. Run the demo and see how it looks....

feat(accordion): updates as per comments

feat(accordion): changed default into primary

feat(accordion): removed ngOnInit

feat(accordion): removed default type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accordian/Card Bootstrap Color Options
2 participants