This commit is contained in:
konnorrogers
2024-03-13 14:24:48 -04:00
parent 418bd1c0d9
commit 005fbee2d7
2 changed files with 6 additions and 9 deletions

View File

@@ -144,9 +144,9 @@ export default class SlTree extends ShoelaceElement {
.forEach((status: 'expand' | 'collapse') => {
const existingIcon = item.querySelector(`[slot="${status}-icon"]`);
const expandButtonIcon = this.getExpandButtonIcon(status)
const expandButtonIcon = this.getExpandButtonIcon(status);
if (!expandButtonIcon) return
if (!expandButtonIcon) return;
if (existingIcon === null) {
// No separator exists, add one

View File

@@ -753,7 +753,6 @@ describe('<sl-tree>', () => {
});
});
// https://github.com/shoelace-style/shoelace/issues/1916
it("Should not render 'null' if it can't find a custom icon", async () => {
const tree = await fixture<SlTree>(html`
@@ -761,9 +760,7 @@ describe('<sl-tree>', () => {
<sl-tree-item>
Item 1
<sl-icon name="1-circle" slot="expand-icon"></sl-icon>
<sl-tree-item>
Item A
</sl-tree-item>
<sl-tree-item> Item A </sl-tree-item>
</sl-tree-item>
<sl-tree-item>
Item 2
@@ -776,8 +773,8 @@ describe('<sl-tree>', () => {
<sl-tree-item>Item B</sl-tree-item>
</sl-tree-item>
</sl-tree>
`)
`);
expect(tree.textContent).to.not.includes("null")
})
expect(tree.textContent).to.not.includes('null');
});
});