Skip to content

Commit

Permalink
Merge pull request #655 from carbon-design-system/dev
Browse files Browse the repository at this point in the history
`v1.27.0`
  • Loading branch information
SimonFinney authored Jul 7, 2020
2 parents 5247db1 + 90c3939 commit c9e5303
Show file tree
Hide file tree
Showing 210 changed files with 2,894 additions and 3,562 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ node_modules
/scss
storybook-static

# CSS Gridish.
src/globals/grid/css-gridish/css
src/globals/grid/css-gridish/bx-grid.sketch

# Logs.
*.log

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.15
12
5 changes: 4 additions & 1 deletion .storybook/index.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
////
/// Entry point.
/// @group storybook
/// @copyright IBM Security 2019
/// @copyright IBM Security 2019 - 2020
////

@import '@carbon/layout/scss/spacing';

@import '../src/globals/index';

@import 'carbon-components/scss/globals/scss/vars';

@import '../src/components/index';
@import '../src/platform/index';

Expand Down
Binary file removed .yarn/offline-mirror/acorn-babel-0.11.1-32.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ansi-cyan-0.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ansi-red-0.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ansi-regex-0.2.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ansi-styles-1.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/arr-diff-1.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/arr-union-2.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/array-slice-0.2.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ast-types-0.6.16.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ast-types-0.8.15.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/async-each-0.1.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/babel-4.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/beeper-1.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/chalk-0.5.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/chokidar-0.12.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/clone-0.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/clone-stats-0.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/core-js-0.5.4.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/css-gridish-2.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/dateformat-2.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/deepmerge-4.2.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/deprecated-0.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/detect-indent-3.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/detect-indent-6.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/editorconfig-0.15.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/end-of-stream-0.1.5.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/estraverse-1.9.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/esutils-1.1.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/extend-shallow-1.1.4.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/find-index-0.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/first-chunk-stream-1.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/fs-readdir-recursive-0.1.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/fsevents-0.3.8.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gaze-0.5.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob-3.1.21.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob-4.5.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob-stream-3.1.18.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob-watcher-0.0.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/glob2base-0.0.12.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/globals-6.4.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/globule-0.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/graceful-fs-1.2.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/graceful-fs-2.0.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/graceful-fs-3.0.12.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-3.9.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-clean-css-3.10.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-json-editor-2.5.4.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-rename-1.4.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-sass-3.2.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-util-3.0.8.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/gulp-zip-4.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/has-ansi-0.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/has-gulplog-0.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/inherits-1.0.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/is-integer-1.0.7.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/js-beautify-1.10.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/js-tokenizer-1.3.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/json-sass-1.3.5.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/kind-of-1.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/leven-1.0.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/liftoff-2.5.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash-1.0.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash-2.4.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash-3.10.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash-node-2.4.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._basecopy-3.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._basetostring-3.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._basevalues-3.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._getnative-3.9.1.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._reescape-3.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash._reevaluate-3.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.escape-3.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.isarguments-3.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.isarray-3.0.4.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.keys-3.1.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.restparam-3.6.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/lodash.template-3.6.2.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/lru-cache-2.7.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/minimatch-0.2.14.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/minimatch-2.0.10.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/multipipe-0.1.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/natives-1.1.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/object-assign-2.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/object-assign-3.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/once-1.3.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/orchestrator-0.3.8.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/ordered-read-streams-0.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/output-file-sync-1.1.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/plugin-error-0.1.2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/plugin-error-1.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/readdirp-1.3.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/recast-0.10.43.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/regenerator-babel-0.8.10-2.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/regexpu-1.3.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/repeating-1.1.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/replace-ext-0.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/semver-4.3.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/sequencify-0.0.7.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/sigmund-1.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/source-map-0.1.32.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/source-map-0.1.43.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/source-map-support-0.2.10.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/source-map-to-comment-1.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/stream-consume-0.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/strip-ansi-0.3.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/strip-bom-1.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/supports-color-0.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/through2-2.0.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/through2-map-3.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/tildify-1.2.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/trim-right-1.0.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/unique-stream-1.0.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/user-home-1.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/v8flags-2.1.1.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/vinyl-0.4.6.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/vinyl-0.5.3.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/vinyl-fs-0.3.14.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/vinyl-paths-2.1.0.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/vinyl-source-stream-2.0.0.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/yazl-2.5.1.tgz
Binary file not shown.
18 changes: 18 additions & 0 deletions config/jest/helpers/renderWithinLandmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @file Helper to render jsx in a landmark element.
* @copyright IBM Security 2020
*/

import { render } from '@testing-library/react';

function renderWithinLandmark(jsxExpression) {
// DAP requires a landmark '<main>' in the DOM:
const container = document.createElement('main');
document.body.appendChild(container);

return render(jsxExpression, {
container,
});
}

export default renderWithinLandmark;
36 changes: 17 additions & 19 deletions docs/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,25 @@ Use this structure for automated accessibility tests:

```jsx
test('should have no Axe or DAP violations', async () => {
const main = document.createElement('main');
render(<Component />, {
// DAP requires a landmark '<main>' in the DOM:
container: document.body.appendChild(main),
});

await expect(document.body).toHaveNoAxeViolations();
await expect(document.body).toHaveNoDAPViolations('ComponentName');
const { container } = render(<Component />);

await expect(container).toHaveNoAxeViolations();
await expect(container).toHaveNoDAPViolations('ComponentName');
});

test('should have no Axe or DAP violations with component variation', async () => {
const main = document.createElement('main');
render(<Component variationProp={value} />, {
// DAP requires a landmark '<main>' in the DOM:
container: document.body.appendChild(main),
});

await expect(document.body).toHaveNoAxeViolations();
await expect(document.body).toHaveNoDAPViolations(
'ComponentName with variation'
);
const { container } = render(<Component variationProp={value} />);

await expect(container).toHaveNoAxeViolations();
await expect(container).toHaveNoDAPViolations('ComponentName with variation');
});

test('should have no Axe or DAP violations with component variation that should be wrapped in a landmark node', async () => {
// `renderWithinLandmark` can be used to wrap a component in a `main` node:
const { container } = renderWithinLandmark(<Component />);

await expect(container).toHaveNoAxeViolations();
await expect(container).toHaveNoDAPViolations('ComponentName');
});
```

Expand All @@ -45,7 +43,7 @@ test('should have no Axe or DAP violations with component variation', async () =

#### DAP requirements

- DAP requires that components be rendered inside a valid landmark element, which is why the `container` is a `main` node. This extra step may not be required if the component is already wrapped in a `main` or another significant HTML landmark element.
- DAP requires that components be rendered inside a valid landmark element. Use the `renderWithinLandmark` helper to wrap a component in a landmark `main` node.
- DAP requires a unique id per test within a given component. (Hence, "ComponentName" and "ComponentName with variation")

## User events
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carbon/ibm-security",
"version": "1.26.0",
"version": "1.27.0-prerelease.4",
"description": "Carbon for IBM Security",
"license": "Apache-2.0",
"main": "lib/index.js",
Expand All @@ -15,7 +15,6 @@
"build": "run-s build:*",
"build:pre": "run-s build:pre:*",
"build:pre:clean": "rm -rf css es lib scss storybook-static",
"build:pre:grid": "css-gridish",
"build:main": "run-p build:main:*",
"build:main:copy-assets": "node scripts/copyAssets.js",
"build:main:cjs": "babel src -d lib --ignore **/_mocks_/**,**/__tests__/**,**/*.stories.js,src/globals/scss-exports/index.js",
Expand All @@ -25,7 +24,7 @@
"build:main:styles": "node scripts/styles.js",
"build:post": "run-p build:post:*",
"build:post:clean-css": "cleancss -O2 -o css/index.min.css css/index.css",
"build:post:storybook": "run-s build:pre:grid && build-storybook -s public",
"build:post:storybook": "build-storybook -s public",
"docs": "node scripts/themes && git add docs/themes/themes.md",
"format": "yarn format:precommit '**/*.{js,md,scss}'",
"format:precommit": "prettier --ignore-path .gitignore --write",
Expand All @@ -37,7 +36,7 @@
"lint:scss:precommit": "stylelint --fix --ignore-path .gitignore",
"lint-staged": "lint-staged",
"semantic-release": "semantic-release",
"start": "run-s build:pre:grid && start-storybook -p 3000 -s public",
"start": "start-storybook -p 3000 -s public",
"test": "yarn jest spec --ci -i",
"test:precommit": "yarn jest -b --passWithNoTests --testMatch src/**/*.spec.js --findRelatedTests",
"test:imports": "scripts/checkImports.sh",
Expand Down Expand Up @@ -116,7 +115,6 @@
"babel-plugin-ramda": "^2.0.0",
"clean-css-cli": "^4.1.11",
"colors": "^1.4.0",
"css-gridish": "^2.0.0",
"css-loader": "^3.0.0",
"data-uri.macro": "^1.0.0",
"del": "^3.0.0",
Expand Down
Loading

0 comments on commit c9e5303

Please sign in to comment.