change cypress tests to ui only

This commit is contained in:
Eduard Heimbuch
2020-08-10 11:36:46 +02:00
parent 5e7739480b
commit 6ab80236f7
10 changed files with 98 additions and 93 deletions

View File

@@ -33,9 +33,10 @@ type Props = RoutingProps & {
label: string;
title?: string;
icon?: string;
className?: string;
};
const NavLink: FC<Props> = ({ to, activeWhenMatch, activeOnlyWhenExact, icon, label, title }) => {
const NavLink: FC<Props> = ({ to, activeWhenMatch, activeOnlyWhenExact, icon, label, title, className }) => {
const active = useActiveMatch({ to, activeWhenMatch, activeOnlyWhenExact });
const context = useMenuContext();
@@ -52,7 +53,7 @@ const NavLink: FC<Props> = ({ to, activeWhenMatch, activeOnlyWhenExact, icon, la
return (
<li title={collapsed ? title : undefined}>
<Link className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "")} to={to}>
<Link className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "", className)} to={to}>
{showIcon}
{collapsed ? null : label}
</Link>

View File

@@ -40,7 +40,7 @@ class PrimaryNavigation extends React.Component<Props> {
return (to: string, match: string, label: string, linkName: string) => {
const link = links[linkName];
if (link) {
const navigationItem = <PrimaryNavigationLink to={to} match={match} label={t(label)} key={linkName} />;
const navigationItem = <PrimaryNavigationLink className={t(label)} to={to} match={match} label={t(label)} key={linkName} />;
navigationItems.push(navigationItem);
}
};

View File

@@ -23,19 +23,21 @@
*/
import * as React from "react";
import { Route, Link } from "react-router-dom";
import classNames from "classnames";
type Props = {
to: string;
label: string;
match?: string;
activeOnlyWhenExact?: boolean;
className?: string;
};
class PrimaryNavigationLink extends React.Component<Props> {
renderLink = (route: any) => {
const { to, label } = this.props;
const { to, label, className } = this.props;
return (
<li className={route.match ? "is-active" : ""}>
<li className={classNames(route.match ? "is-active" : "", className)}>
<Link to={to}>{label}</Link>
</li>
);

View File

@@ -32,9 +32,10 @@ type Props = RoutingProps & {
label: string;
title?: string;
icon?: string;
className?: string;
};
const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, activeWhenMatch, icon, title, label, children }) => {
const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, activeWhenMatch, icon, title, label, children, className }) => {
const context = useMenuContext();
const collapsed = context.isCollapsed();
@@ -60,7 +61,7 @@ const SubNavigation: FC<Props> = ({ to, activeOnlyWhenExact, activeWhenMatch, ic
return (
<li title={collapsed ? title : undefined}>
<Link className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "")} to={to}>
<Link className={classNames(active ? "is-active" : "", collapsed ? "has-text-centered" : "", className)} to={to}>
<i className={classNames(defaultIcon, "fa-fw")} /> {collapsed ? "" : label}
</Link>
{childrenList}