-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
230 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# `Action menu` | ||
|
||
#### `loads` | ||
|
||
```html | ||
Select a Country with a very long label, too long in fact | ||
<sp-menu role="listbox" slot="options"> | ||
<sp-menu-item role="menuitem" tabindex="-1"> | ||
Deselect | ||
</sp-menu-item> | ||
<sp-menu-item role="menuitem" tabindex="-1"> | ||
Select Inverse | ||
</sp-menu-item> | ||
<sp-menu-item role="menuitem" tabindex="-1"> | ||
Feather... | ||
</sp-menu-item> | ||
<sp-menu-item role="menuitem" tabindex="-1"> | ||
Select and Mask... | ||
</sp-menu-item> | ||
<sp-menu-divider role="separator"></sp-menu-divider> | ||
<sp-menu-item role="menuitem" tabindex="-1"> | ||
Save Selection | ||
</sp-menu-item> | ||
<sp-menu-item | ||
aria-disabled="true" | ||
disabled="" | ||
role="menuitem" | ||
tabindex="-1" | ||
> | ||
Make Work Path | ||
</sp-menu-item> | ||
</sp-menu> | ||
``` | ||
|
||
```html | ||
<sp-icons-medium style="display: none;"></sp-icons-medium> | ||
<button aria-haspopup="true" id="button" tabindex="0"></button> | ||
<sp-popover direction="bottom" id="popover"> | ||
<slot name="options"> | ||
<sp-menu-item | ||
aria-disabled="true" | ||
disabled="" | ||
role="menuitem" | ||
tabindex="-1" | ||
> | ||
There are no options currently available. | ||
</sp-menu-item> | ||
</slot> | ||
</sp-popover> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Copyright 2019 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
|
||
import { fixture, elementUpdated } from '@open-wc/testing'; | ||
import { ActionMenu } from '../lib/action-menu'; | ||
import '../lib/action-menu'; | ||
import { html } from 'lit-element'; | ||
import { expect } from '@bundled-es-modules/chai'; | ||
|
||
describe('Action menu', () => { | ||
it('loads', async () => { | ||
const el = await fixture<ActionMenu>( | ||
html` | ||
<sp-action-menu> | ||
Select a Country with a very long label, too long in fact | ||
<sp-menu slot="options" role="listbox"> | ||
<sp-menu-item> | ||
Deselect | ||
</sp-menu-item> | ||
<sp-menu-item> | ||
Select Inverse | ||
</sp-menu-item> | ||
<sp-menu-item> | ||
Feather... | ||
</sp-menu-item> | ||
<sp-menu-item> | ||
Select and Mask... | ||
</sp-menu-item> | ||
<sp-menu-divider></sp-menu-divider> | ||
<sp-menu-item> | ||
Save Selection | ||
</sp-menu-item> | ||
<sp-menu-item disabled> | ||
Make Work Path | ||
</sp-menu-item> | ||
</sp-menu> | ||
</sp-action-menu> | ||
` | ||
); | ||
|
||
await elementUpdated(el); | ||
expect(el).to.not.be.undefined; | ||
// @ts-ignore | ||
expect(el).lightDom.to.equalSnapshot(); | ||
// @ts-ignore | ||
expect(el).shadowDom.to.equalSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters