-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dashboard] new, bulk actions for delete & export #8979
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b874200
bulk actions for dashboards list view
nytai 2a8d73a
add confirm component
nytai 4c58f74
finish bulk actions work
nytai 217464a
remove loading component
nytai 1d81af3
fix sortby double render bug, lint, fix specs
nytai 8d637f3
adds spec for bulk actions
nytai f94e635
fix spec
nytai f2d4bab
spec ConfirmStatusChange
nytai 6bb1918
lint
nytai 2c1a9fd
tslint
nytai 796c74e
address review feedback
nytai a0a9428
tslint fixes
nytai 936cdf7
guard against empty filterTypes
nytai d103cc5
persist dom events
nytai 54a10f5
tslint
nytai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
60 changes: 60 additions & 0 deletions
60
superset/assets/spec/javascripts/components/ConfirmStatusChange_spec.jsx
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,60 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { Modal, Button } from 'react-bootstrap'; | ||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange'; | ||
|
||
describe('ConfirmStatusChange', () => { | ||
const mockedProps = { | ||
title: 'please confirm', | ||
description: 'are you sure?', | ||
onConfirm: jest.fn(), | ||
}; | ||
const wrapper = mount( | ||
<ConfirmStatusChange {...mockedProps}> | ||
{confirm => ( | ||
<> | ||
<button id="btn1" onClick={confirm} /> | ||
</> | ||
)} | ||
</ConfirmStatusChange>, | ||
); | ||
|
||
it('opens a confirm modal', () => { | ||
wrapper | ||
.find('#btn1') | ||
.props() | ||
.onClick('foo'); | ||
|
||
wrapper.update(); | ||
|
||
expect(wrapper.find(Modal).exists()).toBeTruthy(); | ||
}); | ||
|
||
it('calls the function on confirm', () => { | ||
wrapper | ||
.find(Button) | ||
.last() | ||
.props() | ||
.onClick(); | ||
|
||
expect(mockedProps.onConfirm).toHaveBeenCalledWith('foo'); | ||
}); | ||
}); |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t('please confirm')
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a test, so raw string should be ok.