Add tests for logger warning output when slots override attributes for box, modal, tooltip, tab and tab-group
Add tests for processing of scroll-top-button and a-point
Add test for logger warning output when content attribute overrides src attribute in popover
Refactor some existing tests to test each overridden attribute individually instead of all of them together
Anything you'd like to highlight/discuss:
Inconsistent Test Inputs across Components
For some components, the test inputs test for all attributes at once to see if they are being checked properly, e.g.
export const PROCESS_PANEL_ATTRIBUTES = `
<panel header="# Lorem ipsum" alt="_emphasized alt_">
Header and alt attributes should be processed and inserted under panel as slots and internal slots respectively and deleted.
</panel>
`;
export const PROCESS_PANEL_ATTRIBUTES_EXPECTED = `
<panel><template #header><h1>Lorem ipsum</h1>
</template><template #_alt><p><em>emphasized alt</em></p>
</template>
Header and alt attributes should be processed and inserted under panel as slots and internal slots respectively and deleted.
</panel>
`;
where both the header and alt attributes are tested at the same time. However, for other components e.g. box, these are tested one at a time:
export const PROCESS_BOX_ICON = `
<box icon=":rocket:">
Icon attribute should be inserted as icon slot and deleted.
</box>
`;
export const PROCESS_BOX_ICON_EXPECTED = `
<box><template #icon>🚀</template>
Icon attribute should be inserted as icon slot and deleted.
</box>
`;
export const PROCESS_BOX_HEADER = `
<box header="#### Lorem ipsum dolor sit amet :rocket:">
Header attribute should be inserted as header slot and deleted.
</box>
`;
export const PROCESS_BOX_HEADER_EXPECTED = `
<box><template #header><h4>Lorem ipsum dolor sit amet 🚀</h4>
</template>
Header attribute should be inserted as header slot and deleted.
</box>
`;
Do let me know which one you prefer and I will refactor accordingly. Personally I don't see a real need to separate the attributes for the tests.
Other things
Documentation for which attributes are able to be overridden will be done in a separate PR.
Lastly, sorry for the long PR :(
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add tests for logger output when overriding attributes
Currently only certain components are tested for logger warnings
when their attributes are overridden by slots.
Let's add tests for the remaining attributes and components, as well
as add missing tests for the components which do not currently
have tests.
Checklist: :ballot_box_with_check:
[ ] Updated the documentation for feature additions and enhancements
What is the purpose of this pull request?
Fixes #2476
Overview of changes:
box
,modal
,tooltip
,tab
andtab-group
scroll-top-button
anda-point
content
attribute overridessrc
attribute inpopover
Anything you'd like to highlight/discuss:
Inconsistent Test Inputs across Components
For some components, the test inputs test for all attributes at once to see if they are being checked properly, e.g.
where both the
header
andalt
attributes are tested at the same time. However, for other components e.g.box
, these are tested one at a time:Do let me know which one you prefer and I will refactor accordingly. Personally I don't see a real need to separate the attributes for the tests.
Other things
Documentation for which attributes are able to be overridden will be done in a separate PR.
Lastly, sorry for the long PR :(
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add tests for logger output when overriding attributes
Currently only certain components are tested for logger warnings when their attributes are overridden by slots.
Let's add tests for the remaining attributes and components, as well as add missing tests for the components which do not currently have tests.
Checklist: :ballot_box_with_check:
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major
,r.Minor
,r.Patch
.Breaking change release note preparation (if applicable):