Add E2E tests using Cypress

This commit is contained in:
Misode
2021-12-26 02:48:21 +01:00
parent 1e4f82129a
commit ffb2949f05
16 changed files with 2941 additions and 16 deletions

View File

@@ -3,17 +3,18 @@ import type { Octicon } from '.'
import { Btn } from '.'
import { useFocus } from '../hooks'
type BtnMenuProps = {
interface BtnMenuProps extends JSX.HTMLAttributes<HTMLDivElement> {
icon?: keyof typeof Octicon,
label?: string,
relative?: boolean,
tooltip?: string,
children: ComponentChildren,
}
export function BtnMenu({ icon, label, relative, tooltip, children }: BtnMenuProps) {
export function BtnMenu(props: BtnMenuProps) {
const { icon, label, relative, tooltip, children } = props
const [active, setActive] = useFocus()
return <div class={`btn-menu${relative === false ? ' no-relative' : ''}`}>
return <div class={`btn-menu${relative === false ? ' no-relative' : ''}`} {...props}>
<Btn {...{icon, label, tooltip}} onClick={setActive} />
{active && <div class="btn-group">
{children}