-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into CommentList-Colors
- Loading branch information
Showing
256 changed files
with
6,287 additions
and
12,697 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,75 @@ | ||
# 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml | ||
|
||
steps: | ||
- agents: | ||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":typescript: Linting" | ||
agents: | ||
provider: "gcp" | ||
command: .buildkite/scripts/pipeline_test.sh | ||
if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup | ||
env: | ||
TEST_TYPE: 'lint' | ||
if: build.branch != "main" # This job is triggered by the combined test and deploy docs for every PR | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TS unit tests" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:ts' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 16" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx:16' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 17" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx:17' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 18" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 16" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:16' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" | ||
- "cypress/videos/**/*.mp4" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 17" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:17' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" | ||
- "cypress/videos/**/*.mp4" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 18" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:18' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" | ||
- "cypress/videos/**/*.mp4" |
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 +1 @@ | ||
18.17.1 | ||
18.18.1 |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { hideStorybookControls, disableStorybookControls } from './utils'; | ||
|
||
describe('hideStorybookControls', () => { | ||
it('outputs the expected `argTypes` object when passed prop name strings', () => { | ||
expect( | ||
hideStorybookControls(['isDisabled', 'isLoading', 'isInvalid']) | ||
).toEqual({ | ||
isDisabled: { table: { disable: true } }, | ||
isLoading: { table: { disable: true } }, | ||
isInvalid: { table: { disable: true } }, | ||
}); | ||
}); | ||
|
||
it('throws a typescript error if a generic is passed and the prop names do not match', () => { | ||
type TestComponentProps = { hello: boolean; world: boolean }; | ||
// No typescript error | ||
hideStorybookControls<TestComponentProps>(['hello', 'world']); | ||
// @ts-expect-error - will fail `yarn lint` if a TS error is *not* produced | ||
hideStorybookControls<TestComponentProps>(['hello', 'world', 'error']); | ||
}); | ||
}); | ||
|
||
describe('disableStorybookControls', () => { | ||
it('outputs the expected `argTypes` object when passed prop name strings', () => { | ||
expect( | ||
disableStorybookControls(['isDisabled', 'isLoading', 'isInvalid']) | ||
).toEqual({ | ||
isDisabled: { control: false }, | ||
isLoading: { control: false }, | ||
isInvalid: { control: false }, | ||
}); | ||
}); | ||
|
||
it('throws a typescript error if a generic is passed and the prop names do not match', () => { | ||
type TestComponentProps = { hello: boolean; world: boolean }; | ||
// No typescript error | ||
disableStorybookControls<TestComponentProps>(['hello', 'world']); | ||
// @ts-expect-error - will fail `yarn lint` if a TS error is *not* produced | ||
disableStorybookControls<TestComponentProps>(['hello', 'world', 'error']); | ||
}); | ||
}); |
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,64 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
/** | ||
* argTypes configurations | ||
*/ | ||
|
||
/** | ||
* Completely hide props from Storybook's controls panel. | ||
* Should be passed or spread to `argTypes` | ||
*/ | ||
export const hideStorybookControls = <Props>( | ||
propNames: Array<keyof Props> | ||
): Record<keyof Props, typeof HIDE_CONTROL> | {} => { | ||
return propNames.reduce( | ||
(obj, name) => ({ ...obj, [name]: HIDE_CONTROL }), | ||
{} | ||
); | ||
}; | ||
const HIDE_CONTROL = { table: { disable: true } }; | ||
|
||
/** | ||
* Leave props visible in Storybook's controls panel, but disable them | ||
* from being controllable (renders a `-`). | ||
* | ||
* Should be passed or spread to `argTypes` | ||
*/ | ||
export const disableStorybookControls = <Props>( | ||
propNames: Array<keyof Props> | ||
): Record<keyof Props, typeof DISABLE_CONTROL> | {} => { | ||
return propNames.reduce( | ||
(obj, name) => ({ ...obj, [name]: DISABLE_CONTROL }), | ||
{} | ||
); | ||
}; | ||
const DISABLE_CONTROL = { control: false }; | ||
|
||
/** | ||
* parameters configurations | ||
*/ | ||
|
||
/** | ||
* Will hide all props/controls. Pass to `parameters` | ||
* | ||
* TODO: Figure out some way to not show Storybook's "setup" text? | ||
*/ | ||
export const hideAllStorybookControls = { | ||
controls: { exclude: /.*/g }, | ||
}; | ||
|
||
/** | ||
* Will hide the control/addon panel entirely for a specific story. | ||
* Should be passed or spread to to `parameters`. | ||
* | ||
* Note that users can choose to re-show the panel in the UI | ||
*/ | ||
export const hidePanel = { | ||
options: { showPanel: false }, | ||
}; |
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
Oops, something went wrong.