Added cucumber tests (wip)
This commit is contained in:
parent
d798aa2cdf
commit
fb3511b264
11 changed files with 272 additions and 11 deletions
|
|
@ -1,9 +1,12 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { LinkContainer } from 'react-router-bootstrap';
|
||||
/* import { Nav, NavDropdown } from 'react-bootstrap'; */
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
import { testId } from '/imports/ui/components/Utils/TestUtils';
|
||||
|
||||
/*
|
||||
FIXME:
|
||||
navitem needs a nav-link class but does not works
|
||||
|
|
@ -22,10 +25,10 @@ const AuthenticatedNavigation = ({ name, history, props }) => (
|
|||
{/* <LinkContainer className="nav-item" anchorClassName="nav-link" to="/subscriptions">
|
||||
<NavItem eventKey={5} href="/subscriptions"><Trans>Mis alertas</Trans></NavItem>
|
||||
</LinkContainer> */}
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/profile">
|
||||
<LinkContainer id={testId('profile')} className="nav-item" anchorClassName="nav-link" to="/profile">
|
||||
<NavItem eventKey={5.1} href="/profile">{name}</NavItem>
|
||||
</LinkContainer>
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/logout">
|
||||
<LinkContainer id={testId('logout')} className="nav-item" anchorClassName="nav-link" to="/logout">
|
||||
<NavItem eventKey={5.2} onClick={() => history.push('/logout')} href="/logout"><Trans i18nKey="Cerrar sesión">Cerrar sesión</Trans></NavItem>
|
||||
</LinkContainer>
|
||||
{/* </Nav> */}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Navbar } from 'react-bootstrap';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { LinkContainer } from 'react-router-bootstrap';
|
||||
import { Trans, translate } from 'react-i18next';
|
||||
import { testId } from '/imports/ui/components/Utils/TestUtils';
|
||||
import BetaRibbon from '../../components/BetaRibbon/BetaRibbon';
|
||||
import PublicNavigation from '../PublicNavigation/PublicNavigation';
|
||||
import AuthenticatedNavigation from '../AuthenticatedNavigation/AuthenticatedNavigation';
|
||||
|
|
@ -38,12 +41,12 @@ const Navigation = props => (
|
|||
{/* <LinkContainer className="nav-item" anchorClassName="nav-link" to="/sandbox">
|
||||
<NavItem eventKey={1.1} href="/sandbox">Sandbox</NavItem>
|
||||
</LinkContainer> */}
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/subscriptions">
|
||||
<LinkContainer id={testId('subscriptions')} className="nav-item" anchorClassName="nav-link" to="/subscriptions">
|
||||
<NavItem eventKey={1.2} href="/subscriptions">
|
||||
{props.authenticated ? <Trans>Mis zonas</Trans> : <Trans>Participar</Trans>}
|
||||
</NavItem>
|
||||
</LinkContainer>
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/fires">
|
||||
<LinkContainer id={testId('activeFires')} className="nav-item" anchorClassName="nav-link" to="/fires">
|
||||
<NavItem eventKey={2} href="/fires">{props.t('activeFires')}</NavItem>
|
||||
</LinkContainer>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { LinkContainer } from 'react-router-bootstrap';
|
||||
/* import { Nav } from 'react-bootstrap'; */
|
||||
import { translate } from 'react-i18next';
|
||||
import { testId } from '/imports/ui/components/Utils/TestUtils';
|
||||
|
||||
/*
|
||||
FIXME:
|
||||
navitem needs a nav-link class but does not works
|
||||
|
|
@ -15,10 +18,10 @@ import NavItem from '../NavItem/NavItem';
|
|||
const PublicNavigation = props => (
|
||||
<ul className="navbar-nav">
|
||||
{/* <Nav pullRight> */}
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/signup">
|
||||
<LinkContainer id={testId('signup')} className="nav-item" anchorClassName="nav-link" to="/signup">
|
||||
<NavItem eventKey={3} href="/signup">{props.t('Registrarse')}</NavItem>
|
||||
</LinkContainer>
|
||||
<LinkContainer className="nav-item" anchorClassName="nav-link" to="/login">
|
||||
<LinkContainer id={testId('login')} className="nav-item" anchorClassName="nav-link" to="/login">
|
||||
<NavItem eventKey={4} href="/login">{props.t('Iniciar sesión')}</NavItem>
|
||||
</LinkContainer>
|
||||
{/* </Nav> */}
|
||||
|
|
|
|||
9
imports/ui/components/Utils/TestUtils.js
Normal file
9
imports/ui/components/Utils/TestUtils.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { Random } from 'meteor/random';
|
||||
|
||||
export const testId = (id) => {
|
||||
if (Meteor.isDevelopment) {
|
||||
return id;
|
||||
}
|
||||
return Random.id;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue