mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Updated label filtering test to check labels column is populated correctly
no issue - updated assertions to check that labels are shown inside the labels column when filtering members list by label - added a member serializer to mirage so that relationships are correctly expanded to full embedded records
This commit is contained in:
parent
0589f32788
commit
2bf311edc8
15
ghost/admin/mirage/serializers/member.js
Normal file
15
ghost/admin/mirage/serializers/member.js
Normal file
@ -0,0 +1,15 @@
|
||||
import BaseSerializer from './application';
|
||||
|
||||
export default BaseSerializer.extend({
|
||||
embed: true,
|
||||
|
||||
include(request) {
|
||||
let queryIncludes = (request.queryParams.include || '').split(',').compact();
|
||||
const includes = new Set(queryIncludes);
|
||||
|
||||
// embedded records that are included by default in the API
|
||||
includes.add('labels');
|
||||
|
||||
return Array.from(includes);
|
||||
}
|
||||
});
|
@ -96,7 +96,11 @@ describe('Acceptance: Members filtering', function () {
|
||||
|
||||
expect(findAll('[data-test-list="members-list-item"]').length, `# of filtered member rows - ${label.name}`)
|
||||
.to.equal(3);
|
||||
|
||||
// table shows labels column+data
|
||||
expect(find('[data-test-table-column="label"]')).to.exist;
|
||||
expect(findAll('[data-test-table-data="label"]').length).to.equal(3);
|
||||
expect(find('[data-test-table-data="label"]')).to.contain.text(label.name);
|
||||
|
||||
// can delete filter
|
||||
await click('[data-test-delete-members-filter="0"]');
|
||||
|
Loading…
Reference in New Issue
Block a user