mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
test: Update snapshots and mocks
This commit is contained in:
parent
3ca7523a02
commit
234713466e
@ -7,7 +7,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
|
||||
Object {
|
||||
"height": "auto",
|
||||
"maxHeight": "100%",
|
||||
"minHeight": "0",
|
||||
"minHeight": 0,
|
||||
"overflow": "hidden",
|
||||
"position": "relative",
|
||||
"width": "100%",
|
||||
@ -24,7 +24,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
|
||||
"marginBottom": 0,
|
||||
"marginRight": 0,
|
||||
"maxHeight": "calc(100% + 0px)",
|
||||
"minHeight": "calc(0 + 0px)",
|
||||
"minHeight": 0,
|
||||
"overflow": "scroll",
|
||||
"position": "relative",
|
||||
"right": undefined,
|
||||
|
@ -6,7 +6,14 @@ import { getMultipleMockKeys, getMockKey } from './__mocks__/apiKeysMock';
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Api Keys'
|
||||
}
|
||||
} as NavModel,
|
||||
apiKeys: [] as ApiKey[],
|
||||
searchQuery: '',
|
||||
hasFetched: false,
|
||||
|
@ -1,132 +1,158 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Render should render API keys table if there are any keys 1`] = `
|
||||
<div>
|
||||
<Page
|
||||
title="Configuration: Api Keys"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Api Keys",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageLoader
|
||||
pageName="Api keys"
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
`;
|
||||
|
||||
exports[`Render should render CTA if there are no API keys 1`] = `
|
||||
<div>
|
||||
<Page
|
||||
title="Configuration: Api Keys"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
/>
|
||||
<div
|
||||
className="page-container page-body"
|
||||
>
|
||||
<EmptyListCTA
|
||||
model={
|
||||
Object {
|
||||
"buttonIcon": "fa fa-plus",
|
||||
"buttonLink": "#",
|
||||
"buttonTitle": " New API Key",
|
||||
"onClick": [Function],
|
||||
"proTip": "Remember you can provide view-only API access to other applications.",
|
||||
"proTipLink": "",
|
||||
"proTipLinkTitle": "",
|
||||
"proTipTarget": "_blank",
|
||||
"title": "You haven't added any API Keys yet.",
|
||||
}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Api Keys",
|
||||
},
|
||||
}
|
||||
/>
|
||||
<Component
|
||||
in={false}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
>
|
||||
<div
|
||||
className="page-container page-body"
|
||||
>
|
||||
<div
|
||||
className="cta-form"
|
||||
<EmptyListCTA
|
||||
model={
|
||||
Object {
|
||||
"buttonIcon": "fa fa-plus",
|
||||
"buttonLink": "#",
|
||||
"buttonTitle": " New API Key",
|
||||
"onClick": [Function],
|
||||
"proTip": "Remember you can provide view-only API access to other applications.",
|
||||
"proTipLink": "",
|
||||
"proTipLinkTitle": "",
|
||||
"proTipTarget": "_blank",
|
||||
"title": "You haven't added any API Keys yet.",
|
||||
}
|
||||
}
|
||||
/>
|
||||
<Component
|
||||
in={false}
|
||||
>
|
||||
<button
|
||||
className="cta-form__close btn btn-transparent"
|
||||
onClick={[Function]}
|
||||
<div
|
||||
className="cta-form"
|
||||
>
|
||||
<i
|
||||
className="fa fa-close"
|
||||
/>
|
||||
</button>
|
||||
<h5>
|
||||
Add API Key
|
||||
</h5>
|
||||
<form
|
||||
className="gf-form-group"
|
||||
onSubmit={[Function]}
|
||||
>
|
||||
<div
|
||||
className="gf-form-inline"
|
||||
<button
|
||||
className="cta-form__close btn btn-transparent"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<i
|
||||
className="fa fa-close"
|
||||
/>
|
||||
</button>
|
||||
<h5>
|
||||
Add API Key
|
||||
</h5>
|
||||
<form
|
||||
className="gf-form-group"
|
||||
onSubmit={[Function]}
|
||||
>
|
||||
<div
|
||||
className="gf-form max-width-21"
|
||||
className="gf-form-inline"
|
||||
>
|
||||
<span
|
||||
className="gf-form-label"
|
||||
<div
|
||||
className="gf-form max-width-21"
|
||||
>
|
||||
Key name
|
||||
</span>
|
||||
<input
|
||||
className="gf-form-input"
|
||||
onChange={[Function]}
|
||||
placeholder="Name"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="gf-form"
|
||||
>
|
||||
<span
|
||||
className="gf-form-label"
|
||||
>
|
||||
Role
|
||||
</span>
|
||||
<span
|
||||
className="gf-form-select-wrapper"
|
||||
>
|
||||
<select
|
||||
className="gf-form-input gf-size-auto"
|
||||
onChange={[Function]}
|
||||
value="Viewer"
|
||||
<span
|
||||
className="gf-form-label"
|
||||
>
|
||||
<option
|
||||
key="Viewer"
|
||||
label="Viewer"
|
||||
Key name
|
||||
</span>
|
||||
<input
|
||||
className="gf-form-input"
|
||||
onChange={[Function]}
|
||||
placeholder="Name"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="gf-form"
|
||||
>
|
||||
<span
|
||||
className="gf-form-label"
|
||||
>
|
||||
Role
|
||||
</span>
|
||||
<span
|
||||
className="gf-form-select-wrapper"
|
||||
>
|
||||
<select
|
||||
className="gf-form-input gf-size-auto"
|
||||
onChange={[Function]}
|
||||
value="Viewer"
|
||||
>
|
||||
Viewer
|
||||
</option>
|
||||
<option
|
||||
key="Editor"
|
||||
label="Editor"
|
||||
value="Editor"
|
||||
>
|
||||
Editor
|
||||
</option>
|
||||
<option
|
||||
key="Admin"
|
||||
label="Admin"
|
||||
value="Admin"
|
||||
>
|
||||
Admin
|
||||
</option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
className="gf-form"
|
||||
>
|
||||
<button
|
||||
className="btn gf-form-btn btn-success"
|
||||
<option
|
||||
key="Viewer"
|
||||
label="Viewer"
|
||||
value="Viewer"
|
||||
>
|
||||
Viewer
|
||||
</option>
|
||||
<option
|
||||
key="Editor"
|
||||
label="Editor"
|
||||
value="Editor"
|
||||
>
|
||||
Editor
|
||||
</option>
|
||||
<option
|
||||
key="Admin"
|
||||
label="Admin"
|
||||
value="Admin"
|
||||
>
|
||||
Admin
|
||||
</option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
className="gf-form"
|
||||
>
|
||||
Add
|
||||
</button>
|
||||
<button
|
||||
className="btn gf-form-btn btn-success"
|
||||
>
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</Component>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</Component>
|
||||
</div>
|
||||
</PageContents>
|
||||
</Page>
|
||||
`;
|
||||
|
@ -10,7 +10,14 @@ const setup = (propOverrides?: object) => {
|
||||
dataSources: [] as DataSource[],
|
||||
layoutMode: LayoutModes.Grid,
|
||||
loadDataSources: jest.fn(),
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Data Sources'
|
||||
}
|
||||
} as NavModel,
|
||||
dataSourcesCount: 0,
|
||||
searchQuery: '',
|
||||
setDataSourcesSearchQuery: jest.fn(),
|
||||
|
@ -5,7 +5,16 @@ exports[`Render should render action bar and datasources 1`] = `
|
||||
title="Configuration: Data Sources"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Data Sources",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
@ -154,7 +163,16 @@ exports[`Render should render component 1`] = `
|
||||
title="Configuration: Data Sources"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Data Sources",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
|
@ -6,7 +6,14 @@ import { NavModel, Organization } from '../../types';
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
organization: {} as Organization,
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Org details'
|
||||
}
|
||||
} as NavModel,
|
||||
loadOrganization: jest.fn(),
|
||||
setOrganizationName: jest.fn(),
|
||||
updateOrganization: jest.fn(),
|
||||
|
@ -1,38 +1,64 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Render should render component 1`] = `
|
||||
<div>
|
||||
<Page
|
||||
title="Configuration: Org details"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Org details",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="page-container page-body"
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
>
|
||||
<PageLoader
|
||||
pageName="Organization"
|
||||
<div
|
||||
className="page-container page-body"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</PageContents>
|
||||
</Page>
|
||||
`;
|
||||
|
||||
exports[`Render should render organization and preferences 1`] = `
|
||||
<div>
|
||||
<Page
|
||||
title="Configuration: Org details"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Org details",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<div
|
||||
className="page-container page-body"
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
>
|
||||
<div>
|
||||
<OrgProfile
|
||||
onOrgNameChange={[Function]}
|
||||
onSubmit={[Function]}
|
||||
orgName="Cool org"
|
||||
/>
|
||||
<SharedPreferences
|
||||
resourceUri="org"
|
||||
/>
|
||||
<div
|
||||
className="page-container page-body"
|
||||
>
|
||||
<div>
|
||||
<OrgProfile
|
||||
onOrgNameChange={[Function]}
|
||||
onSubmit={[Function]}
|
||||
orgName="Cool org"
|
||||
/>
|
||||
<SharedPreferences
|
||||
resourceUri="org"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</PageContents>
|
||||
</Page>
|
||||
`;
|
||||
|
@ -6,7 +6,14 @@ import { LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Plugins'
|
||||
}
|
||||
} as NavModel,
|
||||
plugins: [] as Plugin[],
|
||||
searchQuery: '',
|
||||
setPluginsSearchQuery: jest.fn(),
|
||||
|
@ -5,7 +5,16 @@ exports[`Render should render component 1`] = `
|
||||
title="Configuration: Plugins"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Plugins",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
@ -31,7 +40,16 @@ exports[`Render should render list 1`] = `
|
||||
title="Configuration: Plugins"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Plugins",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
|
@ -6,7 +6,14 @@ import { getMockTeam, getMultipleMockTeams } from './__mocks__/teamMocks';
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Team List'
|
||||
}
|
||||
} as NavModel,
|
||||
teams: [] as Team[],
|
||||
loadTeams: jest.fn(),
|
||||
deleteTeam: jest.fn(),
|
||||
|
@ -2,10 +2,19 @@
|
||||
|
||||
exports[`Render should render component 1`] = `
|
||||
<Page
|
||||
title="Configuration: Teams"
|
||||
title="Configuration: Team List"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Team List",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
@ -15,10 +24,19 @@ exports[`Render should render component 1`] = `
|
||||
|
||||
exports[`Render should render teams table 1`] = `
|
||||
<Page
|
||||
title="Configuration: Teams"
|
||||
title="Configuration: Team List"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Team List",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
|
@ -11,7 +11,14 @@ jest.mock('../../core/app_events', () => ({
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
navModel: {} as NavModel,
|
||||
navModel: {
|
||||
main: {
|
||||
text: 'Configuration'
|
||||
},
|
||||
node: {
|
||||
text: 'Users'
|
||||
}
|
||||
} as NavModel,
|
||||
users: [] as OrgUser[],
|
||||
invitees: [] as Invitee[],
|
||||
searchQuery: '',
|
||||
|
@ -5,7 +5,16 @@ exports[`Render should render List page 1`] = `
|
||||
title="Configuration: Users"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Users",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={false}
|
||||
@ -28,7 +37,16 @@ exports[`Render should render component 1`] = `
|
||||
title="Configuration: Users"
|
||||
>
|
||||
<PageHeader
|
||||
model={Object {}}
|
||||
model={
|
||||
Object {
|
||||
"main": Object {
|
||||
"text": "Configuration",
|
||||
},
|
||||
"node": Object {
|
||||
"text": "Users",
|
||||
},
|
||||
}
|
||||
}
|
||||
/>
|
||||
<PageContents
|
||||
isLoading={true}
|
||||
|
Loading…
Reference in New Issue
Block a user