Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_22812535
incubator-superset
提交
0c08bb87
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 搜索 >>
未验证
提交
0c08bb87
编写于
1月 26, 2021
作者:
M
Michael S. Molina
提交者:
GitHub
1月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests errors and warnings - iteration 4 (#12212) (#12223)
上级
0fc9da6b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
62 addition
and
38 deletion
+62
-38
superset-frontend/spec/fixtures/mockDashboardState.js
superset-frontend/spec/fixtures/mockDashboardState.js
+1
-0
superset-frontend/spec/fixtures/mockState.js
superset-frontend/spec/fixtures/mockState.js
+2
-2
superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx
...tend/spec/javascripts/components/AlteredSliceTag_spec.jsx
+7
-3
superset-frontend/spec/javascripts/components/ConfirmStatusChange_spec.jsx
.../spec/javascripts/components/ConfirmStatusChange_spec.jsx
+7
-2
superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx
...nd/spec/javascripts/components/ListView/ListView_spec.jsx
+32
-29
superset-frontend/spec/javascripts/components/SupersetResourceSelect_spec.tsx
...ec/javascripts/components/SupersetResourceSelect_spec.tsx
+3
-0
superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
...avascripts/dashboard/components/DashboardBuilder_spec.jsx
+4
-1
superset-frontend/spec/javascripts/dashboard/components/DashboardGrid_spec.jsx
...c/javascripts/dashboard/components/DashboardGrid_spec.jsx
+2
-0
superset-frontend/spec/javascripts/dashboard/components/gridComponents/Tabs_spec.jsx
...scripts/dashboard/components/gridComponents/Tabs_spec.jsx
+3
-1
superset-frontend/src/components/Menu/LanguagePicker.tsx
superset-frontend/src/components/Menu/LanguagePicker.tsx
+1
-0
未找到文件。
superset-frontend/spec/fixtures/mockDashboardState.js
浏览文件 @
0c08bb87
...
...
@@ -28,4 +28,5 @@ export default {
isPublished
:
true
,
css
:
''
,
focusedFilterField
:
null
,
refreshFrequency
:
0
,
};
superset-frontend/spec/fixtures/mockState.js
浏览文件 @
0c08bb87
...
...
@@ -24,11 +24,11 @@ import { dashboardLayout } from './mockDashboardLayout';
import
dashboardInfo
from
'
./mockDashboardInfo
'
;
import
{
emptyFilters
}
from
'
./mockDashboardFilters
'
;
import
dashboardState
from
'
./mockDashboardState
'
;
import
sliceEntities
from
'
./mockSliceEntities
'
;
import
{
sliceEntitiesForChart
}
from
'
./mockSliceEntities
'
;
export
default
{
datasources
,
sliceEntities
,
sliceEntities
:
sliceEntitiesForChart
,
charts
:
chartQueries
,
nativeFilters
:
nativeFiltersInfo
,
dashboardInfo
,
...
...
superset-frontend/spec/javascripts/components/AlteredSliceTag_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -160,9 +160,13 @@ describe('AlteredSliceTag', () => {
);
const
rows
=
getTableWrapperFromModalBody
(
modalBody
).
find
(
'
tr
'
);
expect
(
rows
).
toHaveLength
(
8
);
const
fakeRow
=
mount
(<
div
>
{
rows
.
get
(
1
)
}
</
div
>);
expect
(
fakeRow
.
find
(
'
tr
'
)).
toHaveLength
(
1
);
expect
(
fakeRow
.
find
(
'
td
'
)).
toHaveLength
(
3
);
const
slice
=
mount
(
<
table
>
<
tbody
>
{
rows
.
get
(
1
)
}
</
tbody
>
</
table
>,
);
expect
(
slice
.
find
(
'
tr
'
)).
toHaveLength
(
1
);
expect
(
slice
.
find
(
'
td
'
)).
toHaveLength
(
3
);
});
});
...
...
superset-frontend/spec/javascripts/components/ConfirmStatusChange_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -19,6 +19,7 @@
import
React
from
'
react
'
;
import
{
mount
}
from
'
enzyme
'
;
import
Button
from
'
src/components/Button
'
;
import
{
act
}
from
'
react-dom/test-utils
'
;
import
{
supersetTheme
,
ThemeProvider
}
from
'
@superset-ui/core
'
;
import
ConfirmStatusChange
from
'
src/components/ConfirmStatusChange
'
;
import
Modal
from
'
src/common/components/Modal
'
;
...
...
@@ -44,7 +45,9 @@ describe('ConfirmStatusChange', () => {
);
it
(
'
opens a confirm modal
'
,
()
=>
{
wrapper
.
find
(
'
#btn1
'
).
first
().
props
().
onClick
(
'
foo
'
);
act
(()
=>
{
wrapper
.
find
(
'
#btn1
'
).
first
().
props
().
onClick
(
'
foo
'
);
});
wrapper
.
update
();
...
...
@@ -52,7 +55,9 @@ describe('ConfirmStatusChange', () => {
});
it
(
'
calls the function on confirm
'
,
()
=>
{
wrapper
.
find
(
Button
).
last
().
props
().
onClick
();
act
(()
=>
{
wrapper
.
find
(
Button
).
last
().
props
().
onClick
();
});
expect
(
mockedProps
.
onConfirm
).
toHaveBeenCalledWith
(
'
foo
'
);
});
...
...
superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -150,37 +150,40 @@ describe('ListView', () => {
it
(
'
calls fetchData on mount
'
,
()
=>
{
expect
(
wrapper
.
find
(
ListView
)).
toExist
();
expect
(
mockedProps
.
fetchData
.
mock
.
calls
[
0
]).
toMatchInlineSnapshot
(
`
Array [
Object {
"filters": Array [],
"pageIndex": 0,
"pageSize": 1,
"sortBy": Array [],
},
]
`
);
expect
(
mockedProps
.
fetchData
.
mock
.
calls
[
0
]).
toMatchInlineSnapshot
(
`
Array [
Object {
"filters": Array [],
"pageIndex": 0,
"pageSize": 1,
"sortBy": Array [],
},
]
`
,
);
});
it
(
'
calls fetchData on sort
'
,
()
=>
{
wrapper
.
find
(
'
[data-test="sort-header"]
'
).
at
(
1
).
simulate
(
'
click
'
);
expect
(
mockedProps
.
fetchData
).
toHaveBeenCalled
();
expect
(
mockedProps
.
fetchData
.
mock
.
calls
[
0
]).
toMatchInlineSnapshot
(
`
Array [
Object {
"filters": Array [],
"pageIndex": 0,
"pageSize": 1,
"sortBy": Array [
Object {
"desc": false,
"id": "id",
},
],
},
]
`
);
expect
(
mockedProps
.
fetchData
.
mock
.
calls
[
0
]).
toMatchInlineSnapshot
(
`
Array [
Object {
"filters": Array [],
"pageIndex": 0,
"pageSize": 1,
"sortBy": Array [
Object {
"desc": false,
"id": "id",
},
],
},
]
`
,
);
});
it
(
'
renders pagination controls
'
,
()
=>
{
...
...
@@ -363,13 +366,14 @@ describe('ListView', () => {
);
});
it
(
'
renders and empty state when there is no data
'
,
()
=>
{
it
(
'
renders and empty state when there is no data
'
,
async
()
=>
{
const
props
=
{
...
mockedProps
,
data
:
[],
};
const
wrapper2
=
factory
(
props
);
await
waitForComponentToPaint
(
wrapper2
);
expect
(
wrapper2
.
find
(
Empty
)).
toExist
();
});
...
...
@@ -461,7 +465,7 @@ describe('ListView', () => {
initialSort
:
[{
id
:
'
something
'
}],
});
a
ct
(
()
=>
{
a
wait
act
(
async
()
=>
{
wrapper2
.
find
(
'
[data-test="card-sort-select"]
'
).
first
().
props
().
onChange
({
desc
:
false
,
id
:
'
something
'
,
...
...
@@ -470,7 +474,6 @@ describe('ListView', () => {
});
});
wrapper2
.
update
();
expect
(
mockedProps
.
fetchData
).
toHaveBeenCalled
();
});
});
superset-frontend/spec/javascripts/components/SupersetResourceSelect_spec.tsx
浏览文件 @
0c08bb87
...
...
@@ -23,10 +23,13 @@ import { Provider } from 'react-redux';
import
configureStore
from
'
redux-mock-store
'
;
import
SupersetResourceSelect
from
'
src/components/SupersetResourceSelect
'
;
import
{
supersetTheme
,
ThemeProvider
}
from
'
@superset-ui/core
'
;
import
fetchMock
from
'
fetch-mock
'
;
describe
(
'
SupersetResourceSelect
'
,
()
=>
{
const
NOOP
=
()
=>
{};
fetchMock
.
get
(
'
glob:*/api/v1/dataset/?q=*
'
,
{});
it
(
'
is a valid element
'
,
()
=>
{
// @ts-ignore
expect
(
...
...
superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -20,7 +20,7 @@ import { Provider } from 'react-redux';
import
React
from
'
react
'
;
import
{
shallow
,
mount
}
from
'
enzyme
'
;
import
sinon
from
'
sinon
'
;
import
fetchMock
from
'
fetch-mock
'
;
import
{
ParentSize
}
from
'
@vx/responsive
'
;
import
{
supersetTheme
,
ThemeProvider
}
from
'
@superset-ui/core
'
;
import
{
Sticky
,
StickyContainer
}
from
'
react-sticky
'
;
...
...
@@ -44,6 +44,8 @@ import WithDragDropContext from 'spec/helpers/WithDragDropContext';
const
dashboardLayout
=
undoableDashboardLayout
.
present
;
const
layoutWithTabs
=
undoableDashboardLayoutWithTabs
.
present
;
fetchMock
.
get
(
'
glob:*/csstemplateasyncmodelview/api/read
'
,
{});
describe
(
'
DashboardBuilder
'
,
()
=>
{
let
favStarStub
;
...
...
@@ -67,6 +69,7 @@ describe('DashboardBuilder', () => {
colorScheme
:
undefined
,
handleComponentDrop
()
{},
setDirectPathToChild
:
sinon
.
spy
(),
setMountedTab
()
{},
};
function
setup
(
overrideProps
,
useProvider
=
false
,
store
=
mockStore
)
{
...
...
superset-frontend/spec/javascripts/dashboard/components/DashboardGrid_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -39,6 +39,8 @@ describe('DashboardGrid', () => {
handleComponentDrop
()
{},
resizeComponent
()
{},
width
:
500
,
isComponentVisible
:
true
,
setDirectPathToChild
()
{},
};
function
setup
(
overrideProps
)
{
...
...
superset-frontend/spec/javascripts/dashboard/components/gridComponents/Tabs_spec.jsx
浏览文件 @
0c08bb87
...
...
@@ -22,7 +22,7 @@ import { shallow } from 'enzyme';
import
sinon
from
'
sinon
'
;
import
{
LineEditableTabs
}
from
'
src/common/components/Tabs
'
;
import
{
Modal
}
from
'
src/common/components
'
;
import
fetchMock
from
'
fetch-mock
'
;
import
{
styledMount
as
mount
}
from
'
spec/helpers/theming
'
;
import
DashboardComponent
from
'
src/dashboard/containers/DashboardComponent
'
;
import
DeleteComponentButton
from
'
src/dashboard/components/DeleteComponentButton
'
;
...
...
@@ -35,6 +35,8 @@ import { dashboardLayoutWithTabs } from 'spec/fixtures/mockDashboardLayout';
import
{
mockStoreWithTabs
}
from
'
spec/fixtures/mockStore
'
;
describe
(
'
Tabs
'
,
()
=>
{
fetchMock
.
post
(
'
glob:*/r/shortner/
'
,
{});
const
props
=
{
id
:
'
TABS_ID
'
,
parentId
:
DASHBOARD_ROOT_ID
,
...
...
superset-frontend/src/components/Menu/LanguagePicker.tsx
浏览文件 @
0c08bb87
...
...
@@ -43,6 +43,7 @@ export default function LanguagePicker({
<
NavDropdown
onMouseEnter
=
{
()
=>
setDropdownOpen
(
true
)
}
onMouseLeave
=
{
()
=>
setDropdownOpen
(
false
)
}
onToggle
=
{
value
=>
setDropdownOpen
(
value
)
}
open
=
{
dropdownOpen
}
id
=
"locale-dropdown"
title
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录