mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
Fixed bulk delete members list test
no refs - removes temporary comment on bulk delete member test as its updated to work with filtering in GA
This commit is contained in:
parent
592e3df794
commit
bee3dd8bcd
@ -2,7 +2,7 @@
|
||||
|
||||
<dd.Trigger
|
||||
class="gh-btn gh-btn-icon gh-btn-action-icon"
|
||||
data-test-button="members-actions"
|
||||
data-test-button="members-filter-actions"
|
||||
>
|
||||
<span class="{{if @isFiltered "gh-btn-label-green"}}">
|
||||
{{svg-jar "filter"}}
|
||||
@ -78,6 +78,7 @@
|
||||
</button>
|
||||
<button
|
||||
class="gh-btn gh-btn-primary"
|
||||
data-test-button="members-apply-filter"
|
||||
{{on "click" this.applyFilter}}
|
||||
>
|
||||
<span>Apply filters</span>
|
||||
@ -85,4 +86,4 @@
|
||||
</div>
|
||||
</dd.Content>
|
||||
|
||||
</GhBasicDropdown>
|
||||
</GhBasicDropdown>
|
||||
|
@ -145,53 +145,53 @@ describe('Acceptance: Members', function () {
|
||||
expect(find('[data-test-input="member-email"]').value, 'email has been preserved')
|
||||
.to.equal('example@domain.com');
|
||||
});
|
||||
/**
|
||||
* Commented temporarily for unblocking Filtering GA
|
||||
*/
|
||||
// it('can bulk delete members', async function () {
|
||||
// // members to be kept
|
||||
// this.server.createList('member', 6);
|
||||
|
||||
// // imported members to be deleted
|
||||
// const label = this.server.create('label');
|
||||
// this.server.createList('member', 5, {labels: [label]});
|
||||
it('can bulk delete members', async function () {
|
||||
// members to be kept
|
||||
this.server.createList('member', 6);
|
||||
|
||||
// await visit('/members');
|
||||
// imported members to be deleted
|
||||
const label = this.server.create('label');
|
||||
this.server.createList('member', 5, {labels: [label]});
|
||||
|
||||
// expect(findAll('[data-test-member]').length).to.equal(11);
|
||||
await visit('/members');
|
||||
|
||||
// await click('[data-test-button="members-actions"]');
|
||||
expect(findAll('[data-test-member]').length).to.equal(11);
|
||||
|
||||
// expect(find('[data-test-button="delete-selected"]')).to.not.exist;
|
||||
await click('[data-test-button="members-actions"]');
|
||||
|
||||
// // a filter is needed for the delete-selected button to show
|
||||
// await click('[data-test-button="members-actions"]');
|
||||
// await click(`[data-test-label-filter="${label.name}"]`);
|
||||
expect(find('[data-test-button="delete-selected"]')).to.not.exist;
|
||||
|
||||
// expect(findAll('[data-test-member]').length).to.equal(5);
|
||||
// expect(currentURL()).to.equal('/members?label=label-0');
|
||||
// a filter is needed for the delete-selected button to show
|
||||
await click('[data-test-button="members-filter-actions"]');
|
||||
await click('.gh-member-label-input-labs input');
|
||||
await click(`[data-test-label-filter="${label.name}"]`);
|
||||
await click(`[data-test-button="members-apply-filter"]`);
|
||||
|
||||
// await click('[data-test-button="members-actions"]');
|
||||
expect(findAll('[data-test-member]').length).to.equal(5);
|
||||
expect(currentURL()).to.equal('/members?filter=label%3A%5Blabel-0%5D');
|
||||
|
||||
// expect(find('[data-test-button="delete-selected"]')).to.exist;
|
||||
await click('[data-test-button="members-actions"]');
|
||||
|
||||
// await click('[data-test-button="delete-selected"]');
|
||||
expect(find('[data-test-button="delete-selected"]')).to.exist;
|
||||
|
||||
// expect(find('[data-test-modal="delete-members"]')).to.exist;
|
||||
// expect(find('[data-test-text="delete-count"]')).to.have.text('5 members');
|
||||
await click('[data-test-button="delete-selected"]');
|
||||
|
||||
// await click('[data-test-button="confirm"]');
|
||||
expect(find('[data-test-modal="delete-members"]')).to.exist;
|
||||
expect(find('[data-test-text="delete-count"]')).to.have.text('5 members');
|
||||
|
||||
// expect(find('[data-test-text="deleted-count"]')).to.have.text('5 members');
|
||||
// expect(find('[data-test-button="confirm"]')).to.not.exist;
|
||||
// // members filter is reset
|
||||
// // TODO: fix query params reset for empty strings
|
||||
// expect(currentURL()).to.equal('/members?search=');
|
||||
// expect(findAll('[data-test-member]').length).to.equal(6);
|
||||
await click('[data-test-button="confirm"]');
|
||||
|
||||
// await click('[data-test-button="close-modal"]');
|
||||
expect(find('[data-test-text="deleted-count"]')).to.have.text('5 members');
|
||||
expect(find('[data-test-button="confirm"]')).to.not.exist;
|
||||
// members filter is reset
|
||||
// TODO: fix query params reset for empty strings
|
||||
expect(currentURL()).to.equal('/members?search=');
|
||||
expect(findAll('[data-test-member]').length).to.equal(6);
|
||||
|
||||
// expect(find('[data-test-modal="delete-members"]')).to.not.exist;
|
||||
// });
|
||||
await click('[data-test-button="close-modal"]');
|
||||
|
||||
expect(find('[data-test-modal="delete-members"]')).to.not.exist;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user