Skip to content

Commit

Permalink
chore(tests): co-located the tests with the components
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jun 3, 2019
1 parent b667a33 commit 7c19393
Show file tree
Hide file tree
Showing 25 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"exclude": [
"test/**/*.js",
"src/**/*-test.js",
"scripts/"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"clean": "rimraf lib/",
"lint:md": "globstar --node -- markdownlint **/*.md",
"lint:js": "eslint . .storybook --cache",
"tests:unit": "mocha --recursive test/unit/**/*-test.js",
"tests:unit": "mocha --recursive src/**/*-test.js",
"test": "npm-run-all --print-label --parallel lint:* --sequential coverage --parallel build build-storybook",
"coverage": "nyc run-s tests:unit",
"coverage:report": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import ArchiveListItem from '../../../../src/atoms/archive-list-item';
import ArchiveListItem from '.';

suite('archive list-item', () => {
test('that the meeting details are linked from the list item', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import CopyrightBar from '../../../../src/atoms/copyright';
import CopyrightBar from '.';

suite('copyright bar', () => {
test('that the year-span ends with the current year', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import DsmJsBar from '../../../../../src/atoms/header-bars/dsmJS/index';
import DsmJsBar from '.';

suite('dsmJS bar', () => {
test('that dsmJS is shown', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import LocationBar from '../../../../../src/atoms/header-bars/location/index';
import LocationBar from '.';

suite('location bar', () => {
test('that the location is shown', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import RecurrenceBar from '../../../../../src/atoms/header-bars/recurrence/index';
import RecurrenceBar from '.';

suite('Meeting Recurrence bar', () => {
test('that the recurrence schedule is shown', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import SponsorBar from '../../../../../src/atoms/header-bars/sponsor/index';
import SponsorBar from '.';

suite('sponsor bar', () => {
test('that the sponsor is shown', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import any from '@travi/any';
import {assert} from 'chai';
import PageHeading from '../../../../../src/atoms/headings/page/index';
import PageHeading from '.';

suite('page heading', () => {
test('that the provided text is used for the heading', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import ExternalLink from '../../../../src/atoms/links/external';
import ExternalLink from './external';

suite('external link', () => {
test('that default browser behavior is leveraged', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'gatsby-link';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import InternalLink from '../../../../src/atoms/links/internal';
import InternalLink from './internal';

suite('internal link', () => {
test('that gatsby-link is leveraged', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import Logo from '../../../../src/atoms/logo/index';
import Logo from '.';

suite('logo test', () => {
test('that the png is loaded remotely', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import Link from 'gatsby-link';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import SiteNavigation from '../../../../../src/atoms/navigation/site/index';
import SiteNavigation from '.';

suite('site navigation', () => {
test('that the links are listed', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import SocialIcons from '../../../../src/atoms/social';
import SocialIcons from '.';

suite('user group social icons', () => {
test('that the twitter icon links to the user group\'s twitter profile', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import ArchiveList from '../../../../src/molecules/archive';
import ArchiveList from '.';

suite('archived meetings list molecule', () => {
test('that the meetings are listed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'gatsby-link';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import Header from '../../../../src/molecules/header/index';
import Header from '.';

suite('header', () => {
test('that the header renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import MeetingDetails from '../../../../src/molecules/meeting-details';
import MeetingDetails from '.';

suite('meeting details', () => {
test('that the details are populated from the provided props', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import NavigationBar from '../../../../src/molecules/navigation-bar/index';
import NavigationBar from '.';

suite('navigation bar', () => {
test('that the site navigation and social links are included', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import SponsorDetails from '../../../../src/molecules/sponsor-details';
import SponsorDetails from '.';

suite('sponsor details', () => {
test('that the sponsor name is displayed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import Talk from '../../../../src/molecules/talk';
import Talk from '.';

suite('talk', () => {
test('that the title and speaker details are displayed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import Archive from '../../../../src/organisms/archive';
import Archive from '.';

suite('archived meetings list organism', () => {
test('that the meetings are passed to the list component', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import Footer from '../../../../src/organisms/footer/index';
import Footer from '.';

suite('footer', () => {
test('that the navigation and copyright are included', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import Layout from '../../../../src/organisms/layout';
import Layout from '.';

suite('layout', () => {
function Children() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import {assert} from 'chai';
import any from '@travi/any';
import CurrentMeeting from '../../../../src/organisms/meeting/current';
import CurrentMeeting from './current';

suite('current meeting', () => {
test('that pizza sign-up is added to the meeting details', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {assert} from 'chai';
import {shallow} from 'enzyme';
import any from '@travi/any';
import Meeting from '../../../../src/organisms/meeting';
import Meeting from '.';

suite('meeting', () => {
test('that the meeting is composed of meeting, speaker, and talk details', () => {
Expand Down

0 comments on commit 7c19393

Please sign in to comment.