|
@@ -9,6 +9,7 @@ import {IssueListActions} from 'app/views/issueList/actions';
|
|
|
|
|
|
describe('IssueListActions', function () {
|
|
|
let actions;
|
|
|
+ let actionsWrapper;
|
|
|
let wrapper;
|
|
|
|
|
|
afterEach(() => {
|
|
@@ -45,6 +46,10 @@ describe('IssueListActions', function () {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ afterAll(() => {
|
|
|
+ wrapper.unmount();
|
|
|
+ });
|
|
|
+
|
|
|
it('after checking "Select all" checkbox, displays bulk select message', async function () {
|
|
|
wrapper.find('ActionsCheckbox Checkbox').simulate('change');
|
|
|
expect(wrapper.find('SelectAllNotice')).toSnapshot();
|
|
@@ -110,6 +115,10 @@ describe('IssueListActions', function () {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ afterAll(() => {
|
|
|
+ wrapper.unmount();
|
|
|
+ });
|
|
|
+
|
|
|
it('after checking "Select all" checkbox, displays bulk select message', async function () {
|
|
|
wrapper.find('ActionsCheckbox Checkbox').simulate('change');
|
|
|
expect(wrapper.find('SelectAllNotice')).toSnapshot();
|
|
@@ -174,6 +183,10 @@ describe('IssueListActions', function () {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ afterAll(() => {
|
|
|
+ wrapper.unmount();
|
|
|
+ });
|
|
|
+
|
|
|
it('resolves selected items', function () {
|
|
|
const apiMock = MockApiClient.addMockResponse({
|
|
|
url: '/organizations/org-slug/issues/',
|
|
@@ -248,7 +261,7 @@ describe('IssueListActions', function () {
|
|
|
describe('actionSelectedGroups()', function () {
|
|
|
beforeEach(function () {
|
|
|
jest.spyOn(SelectedGroupStore, 'deselectAll');
|
|
|
- actions = mountWithTheme(
|
|
|
+ actionsWrapper = mountWithTheme(
|
|
|
<IssueListActions
|
|
|
api={new MockApiClient()}
|
|
|
query=""
|
|
@@ -265,7 +278,12 @@ describe('IssueListActions', function () {
|
|
|
realtimeActive={false}
|
|
|
statsPeriod="24h"
|
|
|
/>
|
|
|
- ).instance();
|
|
|
+ );
|
|
|
+ actions = actionsWrapper.instance();
|
|
|
+ });
|
|
|
+
|
|
|
+ afterEach(() => {
|
|
|
+ actionsWrapper.unmount();
|
|
|
});
|
|
|
|
|
|
describe('for all items', function () {
|
|
@@ -328,6 +346,10 @@ describe('IssueListActions', function () {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ afterEach(() => {
|
|
|
+ wrapper.unmount();
|
|
|
+ });
|
|
|
+
|
|
|
it('should disable resolve dropdown but not resolve action', function () {
|
|
|
const resolve = wrapper.find('ResolveActions').first();
|
|
|
expect(resolve.props().disabled).toBe(false);
|
|
@@ -346,9 +368,7 @@ describe('IssueListActions', function () {
|
|
|
describe('with inbox feature', function () {
|
|
|
let issuesApiMock;
|
|
|
beforeEach(async () => {
|
|
|
- GroupStore.init();
|
|
|
- SelectedGroupStore.init();
|
|
|
- await tick();
|
|
|
+ SelectedGroupStore.records = {};
|
|
|
const {organization} = TestStubs.routerContext().context;
|
|
|
wrapper = mountWithTheme(
|
|
|
<IssueListActions
|
|
@@ -381,6 +401,10 @@ describe('IssueListActions', function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ afterEach(() => {
|
|
|
+ wrapper.unmount();
|
|
|
+ });
|
|
|
+
|
|
|
it('acknowledges group', async function () {
|
|
|
wrapper.find('IssueListActions').setState({anySelected: true});
|
|
|
SelectedGroupStore.add(['1', '2', '3']);
|