Skip to content

Commit

Permalink
chore: remove test comment and add slot api descriptions #250
Browse files Browse the repository at this point in the history
  • Loading branch information
rmenner committed Jan 30, 2025
1 parent 45251b5 commit 1b74863
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
9 changes: 6 additions & 3 deletions components/counter/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@

## Slots

| Name | Description |
|-----------|----------------------------|
| `Default` | Slot for counter elements. |
| Name | Description |
|-------------|--------------------------------------------------|
| `Default` | Slot for counter elements. |
| `HelpText` | Dropdown help text content. Only used when `isDropdown` is true. |
| `Label` | Dropdown label content. Only used when `isDropdown` is true. |
| `ValueText` | Dropdown value text display. Only used when `isDropdown` is true. |
3 changes: 3 additions & 0 deletions components/counter/src/auro-counter-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import './auro-counter-wrapper.js';
* @element auro-counter-group
* @extends LitElement
* @slot Default - Slot for counter elements.
* @slot Label - Dropdown label content. Only used when `isDropdown` is true.
* @slot ValueText - Dropdown value text display. Only used when `isDropdown` is true.
* @slot HelpText - Dropdown help text content. Only used when `isDropdown` is true.
*/
export class AuroCounterGroup extends LitElement {
constructor() {
Expand Down
18 changes: 0 additions & 18 deletions components/counter/test/auro-counter-group.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,6 @@ describe('auro-counter-group: rendering logic', () => {
expect(el.counters[1].value).to.equal(0);
});

/*
No matter what I try, I can't get this test to pass.
I can see in the test browser that the default dropdown
trigger content renders, but the test fails.
*/

// it('make sure default dropdown trigger content renders correctly', async () => {
// const el = await fixture(html`
// <auro-counter-group isDropdown>
// <auro-counter value="2">counter1</auro-counter>
// <auro-counter value="3">counter2</auro-counter>
// </auro-counter-group>
// `);
// await elementUpdated(el);
// const defaultTriggerSlot = el.shadowRoot.querySelector('div[slot="trigger"] slot[name="valueText"]');
// expect(defaultTriggerSlot.assignedNodes()[0].textContent.trim()).to.equal('Select');
// });

it('renders the correct value text in the dropdown trigger slot', async () => {
const el = await fixture(html`
<auro-counter-group isDropdown>
Expand Down

0 comments on commit 1b74863

Please sign in to comment.