Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_22812535
incubator-superset
提交
0fc9da6b
I
incubator-superset
项目概览
qq_22812535
/
incubator-superset
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-superset
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
0fc9da6b
编写于
1月 26, 2021
作者:
M
Michael S. Molina
提交者:
GitHub
1月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests errors and warnings - iteration 7 (#12212) (#12245)
上级
e8857bac
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
77 addition
and
19 deletion
+77
-19
superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx
...javascripts/dashboard/components/PropertiesModal_spec.jsx
+23
-7
superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx
...tend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx
+45
-7
superset-frontend/src/views/CRUD/alert/components/AlertStatusIcon.tsx
...ntend/src/views/CRUD/alert/components/AlertStatusIcon.tsx
+3
-1
superset-frontend/src/views/CRUD/data/query/QueryList.tsx
superset-frontend/src/views/CRUD/data/query/QueryList.tsx
+3
-1
superset-frontend/src/views/CRUD/welcome/Welcome.tsx
superset-frontend/src/views/CRUD/welcome/Welcome.tsx
+3
-3
未找到文件。
superset-frontend/spec/javascripts/dashboard/components/PropertiesModal_spec.jsx
浏览文件 @
0fc9da6b
...
...
@@ -19,6 +19,7 @@
import
React
from
'
react
'
;
import
{
mount
}
from
'
enzyme
'
;
import
{
Provider
}
from
'
react-redux
'
;
import
fetchMock
from
'
fetch-mock
'
;
import
{
supersetTheme
,
...
...
@@ -41,6 +42,21 @@ const dashboardResult = {
},
};
fetchMock
.
restore
();
fetchMock
.
get
(
'
glob:*/api/v1/dashboard/related/owners?*
'
,
{
result
:
{},
});
fetchMock
.
get
(
'
glob:*/api/v1/dashboard/*
'
,
{
result
:
{
dashboard_title
:
'
New Title
'
,
slug
:
'
/new
'
,
json_metadata
:
'
{"something":"foo"}
'
,
owners
:
[],
},
});
describe
(
'
PropertiesModal
'
,
()
=>
{
afterEach
(()
=>
{
jest
.
restoreAllMocks
();
...
...
@@ -84,14 +100,14 @@ describe('PropertiesModal', () => {
});
describe
(
'
with metadata
'
,
()
=>
{
describe
(
'
with color_scheme in the metadata
'
,
()
=>
{
const
wrapper
=
setup
();
const
modalInstance
=
wrapper
.
find
(
'
PropertiesModal
'
).
instance
();
modalInstance
.
setState
({
values
:
{
json_metadata
:
'
{"color_scheme": "foo"}
'
,
},
});
it
(
'
will update the metadata
'
,
()
=>
{
const
wrapper
=
setup
();
const
modalInstance
=
wrapper
.
find
(
'
PropertiesModal
'
).
instance
();
modalInstance
.
setState
({
values
:
{
json_metadata
:
'
{"color_scheme": "foo"}
'
,
},
});
const
spy
=
jest
.
spyOn
(
modalInstance
,
'
onMetadataChange
'
);
modalInstance
.
onColorSchemeChange
(
'
SUPERSET_DEFAULT
'
);
expect
(
spy
).
toHaveBeenCalledWith
(
...
...
superset-frontend/spec/javascripts/views/CRUD/welcome/Welcome_spec.tsx
浏览文件 @
0fc9da6b
...
...
@@ -21,15 +21,24 @@ import { styledMount as mount } from 'spec/helpers/theming';
import
{
Provider
}
from
'
react-redux
'
;
import
thunk
from
'
redux-thunk
'
;
import
fetchMock
from
'
fetch-mock
'
;
import
{
act
}
from
'
react-dom/test-utils
'
;
import
configureStore
from
'
redux-mock-store
'
;
import
Welcome
from
'
src/views/CRUD/welcome/Welcome
'
;
import
{
ReactWrapper
}
from
'
enzyme
'
;
const
mockStore
=
configureStore
([
thunk
]);
const
store
=
mockStore
({});
const
chartsEndpoint
=
'
glob:*/api/v1/chart/?*
'
;
const
dashboardEndpoint
=
'
glob:*/api/v1/dashboard/?*
'
;
const
chartInfoEndpoint
=
'
glob:*/api/v1/chart/_info?*
'
;
const
chartFavoriteStatusEndpoint
=
'
glob:*/api/v1/chart/favorite_status?*
'
;
const
dashboardsEndpoint
=
'
glob:*/api/v1/dashboard/?*
'
;
const
dashboardInfoEndpoint
=
'
glob:*/api/v1/dashboard/_info?*
'
;
const
dashboardFavoriteStatusEndpoint
=
'
glob:*/api/v1/dashboard/favorite_status?*
'
;
const
savedQueryEndpoint
=
'
glob:*/api/v1/saved_query/?*
'
;
const
savedQueryInfoEndpoint
=
'
glob:*/api/v1/saved_query/_info?*
'
;
const
recentActivityEndpoint
=
'
glob:*/superset/recent_activity/*
'
;
fetchMock
.
get
(
chartsEndpoint
,
{
result
:
[
...
...
@@ -43,7 +52,7 @@ fetchMock.get(chartsEndpoint, {
],
});
fetchMock
.
get
(
dashboardEndpoint
,
{
fetchMock
.
get
(
dashboard
s
Endpoint
,
{
result
:
[
{
dashboard_title
:
'
Dashboard_Test
'
,
...
...
@@ -58,6 +67,28 @@ fetchMock.get(savedQueryEndpoint, {
result
:
[],
});
fetchMock
.
get
(
recentActivityEndpoint
,
{});
fetchMock
.
get
(
chartInfoEndpoint
,
{
permissions
:
[],
});
fetchMock
.
get
(
chartFavoriteStatusEndpoint
,
{
result
:
[],
});
fetchMock
.
get
(
dashboardInfoEndpoint
,
{
permissions
:
[],
});
fetchMock
.
get
(
dashboardFavoriteStatusEndpoint
,
{
result
:
[],
});
fetchMock
.
get
(
savedQueryInfoEndpoint
,
{
permissions
:
[],
});
describe
(
'
Welcome
'
,
()
=>
{
const
mockedProps
=
{
user
:
{
...
...
@@ -70,11 +101,18 @@ describe('Welcome', () => {
isActive
:
true
,
},
};
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
<
Welcome
{
...
mockedProps
}
/>
</
Provider
>,
);
let
wrapper
:
ReactWrapper
;
beforeAll
(
async
()
=>
{
await
act
(
async
()
=>
{
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
<
Welcome
{
...
mockedProps
}
/>
</
Provider
>,
);
});
});
it
(
'
renders
'
,
()
=>
{
expect
(
wrapper
).
toExist
();
...
...
superset-frontend/src/views/CRUD/alert/components/AlertStatusIcon.tsx
浏览文件 @
0fc9da6b
...
...
@@ -22,7 +22,9 @@ import { Tooltip } from 'src/common/components/Tooltip';
import
Icon
,
{
IconName
}
from
'
src/components/Icon
'
;
import
{
AlertState
}
from
'
../types
'
;
const
StatusIcon
=
styled
(
Icon
)
<
{
status
:
string
;
isReportEnabled
:
boolean
}
>
`
const
StatusIcon
=
styled
(
Icon
,
{
shouldForwardProp
:
prop
=>
prop
!==
'
status
'
&&
prop
!==
'
isReportEnabled
'
,
})
<
{
status
:
string
;
isReportEnabled
:
boolean
}
>
`
color:
${({
status
,
theme
,
isReportEnabled
})
=>
{
switch
(
status
)
{
case
AlertState
.
working
:
...
...
superset-frontend/src/views/CRUD/data/query/QueryList.tsx
浏览文件 @
0fc9da6b
...
...
@@ -80,7 +80,9 @@ const StyledPopoverItem = styled.div`
color:
${({
theme
})
=>
theme
.
colors
.
grayscale
.
dark2
}
;
`
;
const
StatusIcon
=
styled
(
Icon
)
<
{
status
:
string
}
>
`
const
StatusIcon
=
styled
(
Icon
,
{
shouldForwardProp
:
prop
=>
prop
!==
'
status
'
,
})
<
{
status
:
string
}
>
`
color:
${({
status
,
theme
})
=>
{
if
(
status
===
'
success
'
)
return
theme
.
colors
.
success
.
base
;
if
(
status
===
'
failed
'
)
return
theme
.
colors
.
error
.
base
;
...
...
superset-frontend/src/views/CRUD/welcome/Welcome.tsx
浏览文件 @
0fc9da6b
...
...
@@ -62,9 +62,9 @@ const WelcomeContainer = styled.div`
}
}
.nav.navbar-nav {
& > li:nth-
child
(1),
& > li:nth-
child
(2),
& > li:nth-
child
(3) {
& > li:nth-
of-type
(1),
& > li:nth-
of-type
(2),
& > li:nth-
of-type
(3) {
margin-top:
${({
theme
})
=>
theme
.
gridUnit
*
2
}
px;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录