Skip to content

Commit

Permalink
fix duplicate id on collapsible container (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
haonliu authored Jun 18, 2019
1 parent 321b924 commit d4c5f1c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ import { ResultSectionTitle } from './result-section-title';

export type CollapsibleResultSectionProps = ResultSectionProps & {
buttonAriaLabel: string;
containerId: string;
};

export const CollapsibleResultSection = NamedSFC<CollapsibleResultSectionProps>('CollapsibleResultSection', props => {
const { containerClassName, buttonAriaLabel } = props;
const { containerClassName, buttonAriaLabel, containerId } = props;

return (
<div className={containerClassName}>
<CollapsibleContainer
id={containerClassName}
id={containerId}
summaryContent={<ResultSectionTitle {...props} />}
detailsContent={<ResultSectionContent {...props} />}
buttonAriaLabel={buttonAriaLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const NotApplicableChecksSection = NamedSFC<NotApplicableChecksSectionPro
outcomeType="inapplicable"
badgeCount={rules.length}
buttonAriaLabel="show not applicable checks list"
containerId="not-applicable-checks-section"
/>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const PassedChecksSection = NamedSFC<PassedChecksSectionProps>(
outcomeType="pass"
badgeCount={rules.length}
buttonAriaLabel="show passed checks list"
containerId="passed-checks-section"
/>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ exports[`CollapsibleResultSection renders 1`] = `
<ResultSectionContent
buttonAriaLabel="button aria label test"
containerClassName="result-section-class-name"
containerId="container-id"
/>
}
id="result-section-class-name"
id="container-id"
summaryContent={
<ResultSectionTitle
buttonAriaLabel="button aria label test"
containerClassName="result-section-class-name"
containerId="container-id"
/>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`NotApplicableChecksSection renders 1`] = `
badgeCount={3}
buttonAriaLabel="show not applicable checks list"
containerClassName="result-section"
containerId="not-applicable-checks-section"
deps={
Object {
"getGuidanceTagsFromGuidanceLinks": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`PassedChecksSection renders 1`] = `
badgeCount={3}
buttonAriaLabel="show passed checks list"
containerClassName="result-section"
containerId="passed-checks-section"
deps={
Object {
"getGuidanceTagsFromGuidanceLinks": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('CollapsibleResultSection', () => {
const props: CollapsibleResultSectionProps = {
containerClassName: 'result-section-class-name',
buttonAriaLabel: 'button aria label test',
containerId: 'container-id',
} as CollapsibleResultSectionProps;

const wrapper = shallow(<CollapsibleResultSection {...props} />);
Expand Down

0 comments on commit d4c5f1c

Please sign in to comment.