This file contains hidden or 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
| describe('Dashboard tests', () => { | |
| test('Renders dashboard without', async () => { | |
| server.use(getDashboardDataMock(); // first res | |
| const { getByTestId } = render(<Dashboard />); | |
| await waitFor(() => { | |
| expect(getByTestId(/dashboard-trips/i)).toBeNull(); | |
| }); | |
| }); | |
| test('Renders dashboard with trips', async () => { | |
| const { getByText, getAllByTestId } = render(<Dashboard />); |
This file contains hidden or 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
| // Example usage | |
| const idArray = [ | |
| { id: 1, title: "My First Title", body: "My first body text" }, | |
| { id: 2, title: "My Second Title", body: "My second body text" }, | |
| { id: 3, title: "My Third Title", body: "My third body text" }, | |
| ]; | |
| const data = filterArrayOfObjectsByKey(idArray,'id', event.currentTarget.id, myData); | |
| // pretend we are using React state |
This file contains hidden or 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
| /** | |
| * @name mediaQuery | |
| * @desc function to express media queries | |
| * @param {string} size the size in which to invoke media query, represented in px | |
| * @param {string} condition the condition in which to invoke media query. default is 'min' | |
| * @returns returns desc | |
| * @note the func param is to handle dynamic styles rendered by js rendered by a function | |
| */ | |
| import { css } from 'styled-components' |
This file contains hidden or 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
| import React from 'react'; | |
| import styled from 'styled-components'; | |
| // create a base meta data component | |
| export const SVGBase = styled.svg.attrs({ | |
| version: '1.1', | |
| xmlns: 'http://www.w3.org/2000/svg', | |
| xmlnsXlink: 'http://www.w3.org/1999/xlink', | |
| ariaHidden: 'true', |
This file contains hidden or 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
| /** | |
| * @name CU Form Validation | |
| * @desc validate form inputs utilizing functions from validator.js | |
| * @see https://github.com/validatorjs/validator.js | |
| * @author Michael Ieradi | |
| * @version 1.0.0 | |
| * | |
| * @overview | |
| * @func handleValidateOnKeypress() | |
| * @description validate inputs, by attribute, on keypress |
This file contains hidden or 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
| const Title = props => { | |
| switch (true) { | |
| case props.h2: | |
| return <h2>{props.title}</h2>; | |
| case props.h3: | |
| return <h3>{props.title}</h3>; | |
| case props.h4: | |
| return <h4>{props.title}</h4>; |