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:
Kevin Ansfield 2022-02-23 13:54:23 +00:00
parent 0589f32788
commit 2bf311edc8
2 changed files with 19 additions and 0 deletions

View 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);
}
});

View File

@ -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"]');