Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created January 19, 2023 04:47
Show Gist options
  • Save YonatanKra/bd9c6305ab984a133c9ea2cc61ef4802 to your computer and use it in GitHub Desktop.
Save YonatanKra/bd9c6305ab984a133c9ea2cc61ef4802 to your computer and use it in GitHub Desktop.
describe('non multi', () => {
it('should only allow one accordion items open at a time', async () => {
expect(accordionItem1.open).toBeFalsy();
expect(accordionItem2.open).toBeFalsy();
accordionItem1.open = true;
accordionItem2.open = true;
expect(accordionItem1.open).toBeFalsy();
expect(accordionItem2.open).toBeTruthy();
});
});
describe('multi', () => {
it('should allow all accordion items open when multi', async () => {
element.expandmode = 'multi';
expect(accordionItem1.expanded).toBeTruthy();
expect(accordionItem2.expanded).toBeFalsy();
accordionItem1.expanded = true;
accordionItem2.expanded = true;
expect(accordionItem1.expanded).toBeTruthy();
expect(accordionItem2.expanded).toBeTruthy();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment