diff --git a/fixtures/dom/src/components/IssueList.js b/fixtures/dom/src/components/IssueList.js new file mode 100644 index 0000000000000..553fdb3fd8577 --- /dev/null +++ b/fixtures/dom/src/components/IssueList.js @@ -0,0 +1,26 @@ +const React = window.React; + +function csv(string) { + return string.split(/\s*,\s*/); +} + +export default function IssueList({issues}) { + if (!issues) { + return null; + } + + if (typeof issues === 'string') { + issues = csv(issues); + } + + let links = issues.reduce((memo, issue, i) => { + return memo.concat( + i > 0 && i < issues.length ? ', ' : null, + + {issue} + + ); + }, []); + + return {links}; +} diff --git a/fixtures/dom/src/components/TestCase.js b/fixtures/dom/src/components/TestCase.js index e1e6321e269a8..11bd2b39eecb7 100644 --- a/fixtures/dom/src/components/TestCase.js +++ b/fixtures/dom/src/components/TestCase.js @@ -1,7 +1,9 @@ +const React = window.React; + import cn from 'classnames'; import semver from 'semver'; -import React from 'react'; import PropTypes from 'prop-types'; +import IssueList from './IssueList'; import {parse} from 'query-string'; import {semverString} from './propTypes'; @@ -36,6 +38,7 @@ class TestCase extends React.Component { resolvedIn, resolvedBy, affectedBrowsers, + relatedIssues, children, } = this.props; @@ -93,6 +96,9 @@ class TestCase extends React.Component { {affectedBrowsers &&
diff --git a/fixtures/dom/src/components/fixtures/selects/index.js b/fixtures/dom/src/components/fixtures/selects/index.js index ddf5d735fc8eb..1ce590d2833d9 100644 --- a/fixtures/dom/src/components/fixtures/selects/index.js +++ b/fixtures/dom/src/components/fixtures/selects/index.js @@ -1,5 +1,8 @@ const React = window.React; +import FixtureSet from '../../FixtureSet'; +import TestCase from '../../TestCase'; + class SelectFixture extends React.Component { state = {value: ''}; onChange = event => { @@ -7,27 +10,66 @@ class SelectFixture extends React.Component { }; render() { return ( -
+