Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend display for mode-configured loggers
Test Plan: Jest Reviewers: alangenfeld Reviewed By: alangenfeld Differential Revision: https://dagster.phacility.com/D127
- Loading branch information
Showing
7 changed files
with
1,314 additions
and
0 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
177 changes: 177 additions & 0 deletions
177
js_modules/dagit/src/__tests__/SidebarPipelineInfo.test.tsx
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,177 @@ | ||
import * as React from "react"; | ||
import * as TestRenderer from "react-test-renderer"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
|
||
import SidebarPipelineInfo from "../SidebarPipelineInfo"; | ||
import { SidebarPipelineInfoFragment } from "../types/SidebarPipelineInfoFragment"; | ||
|
||
it("renders given a pipeline with resources and loggers", () => { | ||
const sidebarPipelineInfoData: SidebarPipelineInfoFragment = { | ||
__typename: "Pipeline", | ||
name: "A good test pipeline", | ||
description: "Very friendly and helpful", | ||
modes: [ | ||
{ | ||
__typename: "Mode", | ||
name: "one_good_mode", | ||
description: "A way to run your pipeline", | ||
resources: [ | ||
{ | ||
__typename: "Resource", | ||
name: "a_resource", | ||
description: "Very useful", | ||
configField: { | ||
__typename: "ConfigTypeField", | ||
configType: { | ||
__typename: "NullableConfigType", | ||
name: "config", | ||
key: "Dict.88", | ||
description: "A configuration dictionary with typed fields", | ||
innerTypes: [ | ||
{ | ||
__typename: "RegularConfigType", | ||
name: "foo", | ||
key: "Int", | ||
description: null, | ||
innerTypes: [], | ||
isNullable: false, | ||
isList: false, | ||
isSelector: false | ||
} | ||
], | ||
isList: false, | ||
isNullable: true, | ||
isSelector: false | ||
} | ||
} | ||
} | ||
], | ||
loggers: [] | ||
}, | ||
{ | ||
__typename: "Mode", | ||
name: "another_mode", | ||
description: "Another nice way to run your pipeline", | ||
resources: [ | ||
{ | ||
__typename: "Resource", | ||
name: "a_resource", | ||
description: "Very useful", | ||
configField: { | ||
__typename: "ConfigTypeField", | ||
configType: { | ||
__typename: "NullableConfigType", | ||
name: "config", | ||
key: "Dict.88", | ||
description: "A configuration dictionary with typed fields", | ||
innerTypes: [ | ||
{ | ||
__typename: "RegularConfigType", | ||
name: "foo", | ||
key: "Int", | ||
description: null, | ||
innerTypes: [], | ||
isNullable: false, | ||
isList: false, | ||
isSelector: false | ||
} | ||
], | ||
isList: false, | ||
isNullable: true, | ||
isSelector: false | ||
} | ||
} | ||
}, | ||
{ | ||
__typename: "Resource", | ||
name: "b_resource", | ||
description: "Very useful", | ||
configField: { | ||
__typename: "ConfigTypeField", | ||
configType: { | ||
__typename: "NullableConfigType", | ||
name: "config", | ||
key: "Dict.88", | ||
description: "A configuration dictionary with typed fields", | ||
innerTypes: [ | ||
{ | ||
__typename: "RegularConfigType", | ||
name: "foo", | ||
key: "Int", | ||
description: null, | ||
innerTypes: [], | ||
isNullable: false, | ||
isList: false, | ||
isSelector: false | ||
} | ||
], | ||
isList: false, | ||
isNullable: true, | ||
isSelector: false | ||
} | ||
} | ||
} | ||
], | ||
loggers: [ | ||
{ | ||
__typename: "Logger", | ||
name: "console", | ||
description: "The default colored console logger.", | ||
configField: { | ||
__typename: "ConfigTypeField", | ||
configType: { | ||
__typename: "CompositeConfigType", | ||
key: "Dict.23", | ||
name: null, | ||
description: "A configuration dictionary with typed fields", | ||
fields: [ | ||
{ | ||
__typename: "ConfigTypeField", | ||
name: "log_level", | ||
description: null, | ||
configType: { | ||
__typename: "RegularConfigType", | ||
key: "String" | ||
}, | ||
isOptional: true | ||
}, | ||
{ | ||
__typename: "ConfigTypeField", | ||
name: "name", | ||
description: null, | ||
configType: { | ||
__typename: "RegularConfigType", | ||
key: "String" | ||
}, | ||
isOptional: true | ||
} | ||
], | ||
innerTypes: [ | ||
{ | ||
__typename: "RegularConfigType", | ||
name: "String", | ||
key: "String", | ||
description: "", | ||
isList: false, | ||
isNullable: false, | ||
isSelector: false, | ||
innerTypes: [] | ||
} | ||
], | ||
isNullable: false, | ||
isList: false, | ||
isSelector: false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
const component = TestRenderer.create( | ||
<BrowserRouter> | ||
<SidebarPipelineInfo pipeline={sidebarPipelineInfoData} /> | ||
</BrowserRouter> | ||
); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.