-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature(Storybook): upgrade to Storybook v7 Co-authored-by: Josh Howenstine <[email protected]>
- Loading branch information
Showing
199 changed files
with
7,427 additions
and
9,292 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
docs | ||
reports | ||
dist | ||
ci | ||
|
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
53 changes: 53 additions & 0 deletions
53
packages/@lightningjs/ui-components-test-utils/src/docs/Overview.mdx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{/* prettier-ignore */} | ||
{/* | ||
Copyright 2023 Comcast Cable Communications Management, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
SPDX-License-Identifier: Apache-2.0 | ||
\*/} | ||
|
||
import { Meta } from '@storybook/blocks'; | ||
|
||
<Meta title="Docs / Unit Testing / Overview" /> | ||
|
||
# @lightningjs/ui-components-test-utils | ||
|
||
The `@lightningjs/ui-components-test-utils` package provides 2 artifacts to assist with unit testing Lightning components. | ||
|
||
1. **Test Renderer** | ||
|
||
- [create](/story/docs-unit-testing-test-renderer-create--page): Generates a `testRenderer` object with built in utilities for unit testing Lightning Components. | ||
- [toJSON](/story/docs-unit-testing-test-renderer-tojson--page): Converts Lightning components to JSON to be used in [Jest Snapshot Tests](https://jestjs.io/docs/snapshot-testing) | ||
|
||
2. **Test Utils** | ||
|
||
- [makeCreateComponent](/story/docs-unit-testing-test-utils-makecreatecomponent--page): Returns a `createComponent` function which is used to generate an instance of a component to run unit test cases against. | ||
- [completeAnimation](/story/docs-unit-testing-test-utils-completeanimation--page): Returns a Promise that resolves once all animating properties have updated to their target value(s). | ||
- [fastForward](/story/docs-unit-testing-test-utils-fastforward--page): Force all running Lightning Transitions on one or more Lightning Elements to finish and update the transitioning property to its target value immediately. | ||
- [nextTick](/story/docs-unit-testing-test-utils-nexttick--page): Creates a Promise that resolves after a defined amount of time. If no amount of time is specified, the Promise will resolve immediately. | ||
|
||
```js | ||
// jest.config.js | ||
|
||
const config = { | ||
// ...other Jest config properties | ||
setupFiles: ['jest-webgl-canvas-mock'], | ||
transformIgnorePatterns: [ | ||
'/node_modules/(?!(@lightningjs/ui-components-test-utils)/)' | ||
] | ||
// ...other Jest config properties | ||
}; | ||
|
||
export default config; | ||
``` |
55 changes: 0 additions & 55 deletions
55
packages/@lightningjs/ui-components-test-utils/src/docs/Overview.stories.mdx
This file was deleted.
Oops, something went wrong.
29 changes: 15 additions & 14 deletions
29
.../src/docs/TestRenderer/create.stories.mdx → ...st-utils/src/docs/TestRenderer/create.mdx
This file contains 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
Oops, something went wrong.