Skip to content

Commit

Permalink
chore: add some coverage on value-separator
Browse files Browse the repository at this point in the history
  • Loading branch information
adixon-adobe authored and Westbrook committed Jul 29, 2021
1 parent 5dc1e0a commit 1545c67
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/menu/test/menu-group.test.ts
Expand Up @@ -237,15 +237,15 @@ describe('Menu group', () => {
it('handles changing managed items for selects changes', async () => {
const el = await fixture<Menu>(
html`
<sp-menu selects="multiple">
<sp-menu selects="multiple" value-separator="--">
<sp-menu-item selected>First</sp-menu-item>
<sp-menu-item>Second</sp-menu-item>
<sp-menu-group id="mg-inherit">
<sp-menu-item>Inherit1</sp-menu-item>
<sp-menu-item>Inherit2</sp-menu-item>
<sp-menu-group id="mg-sub-inherit">
<sp-menu-item>SubInherit1</sp-menu-item>
<sp-menu-item>SubInherit2</sp-menu-item>
<sp-menu-item selected>SubInherit2</sp-menu-item>
</sp-menu-group>
</sp-menu-group>
</sp-menu>
Expand All @@ -257,8 +257,8 @@ describe('Menu group', () => {
'expected outer menu to manage 6 items'
);
await waitUntil(
() => el.selectedItems.length == 1,
'expected 1 selected item'
() => el.selectedItems.length == 2,
'expected 2 selected item'
);
await elementUpdated(el);

Expand Down Expand Up @@ -290,6 +290,8 @@ describe('Menu group', () => {
expect(subInheritItem2.getAttribute('role')).to.equal(
'menuitemcheckbox'
);
expect(el.value).to.equal('First--SubInherit2');
expect(el.selectedItems.length).to.equal(2);

inheritGroup.setAttribute('selects', 'single');

Expand All @@ -309,5 +311,8 @@ describe('Menu group', () => {
expect(inheritItem2.getAttribute('role')).to.equal('menuitemradio');
expect(subInheritItem1.getAttribute('role')).to.equal('menuitemradio');
expect(subInheritItem2.getAttribute('role')).to.equal('menuitemradio');
expect(el.value).to.equal('First');
//expect(inheritGroup.value).to.equal('SubInherit2')
expect(inheritGroup.selectedItems.length).to.equal(1);
});
});

0 comments on commit 1545c67

Please sign in to comment.