Skip to content

Commit

Permalink
STSMACOM-858: Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrHladchenko1 committed Oct 4, 2024
1 parent b4721fe commit 84ca693
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
16 changes: 6 additions & 10 deletions lib/ControlledVocab/tests/ControlledVocab-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('ControlledVocab', () => {
// eslint-disable-next-line no-undef
beforeEach(() => mountComponent(true, server, { labelSingular }));

it('should have row count 8', () => cv.has({ rowCount: 8 }));
it('should have row count 7', () => cv.has({ rowCount: 7 }));

describe('clicking Delete icon on first row', () => {
beforeEach(async function () {
Expand Down Expand Up @@ -268,22 +268,18 @@ describe('ControlledVocab', () => {
await mountComponent(false, server, { listSuppressor });
});

it('should have row count 8', () => cv.has({ rowCount: 8 }));

it('should render the row with last updated by user-1 without user firstname or lastname', async () => {
await mcl.find(MultiColumnListCell({ row: 4, columnIndex: 3, content: '4/18/2019 by ' })).exists();
});
it('should have row count 7', () => cv.has({ rowCount: 7 }));

it('should render the row with last updated by system with "System" text', async () => {
await mcl.find(MultiColumnListCell({ row: 6, columnIndex: 3, content: '1/9/2024 by System' })).exists();
await mcl.find(MultiColumnListCell({ row: 5, columnIndex: 3, content: '1/9/2024 by System' })).exists();
});

it('should render the row with last updated by system without data about user', async () => {
await mcl.find(MultiColumnListCell({ row: 7, columnIndex: 3, content: '1/9/2024 by System' })).exists();
await mcl.find(MultiColumnListCell({ row: 6, columnIndex: 3, content: '1/9/2024 by System' })).exists();
});

it('should render the row with last updated by unknown user when user was deleted', async () => {
await mcl.find(MultiColumnListCell({ row: 8, columnIndex: 3, content: '1/9/2024 by Unknown user' })).exists();
it('should render the row with last updated by unknown user when user doesn\'t exist', async () => {
await mcl.find(MultiColumnListCell({ row: 7, columnIndex: 3, content: '1/9/2024 by Unknown user' })).exists();
});
});
});
10 changes: 0 additions & 10 deletions lib/ControlledVocab/tests/mountComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ export default async function (editable, server, props) {
'updatedDate' : '2019-04-18T16:41:36.806+0000',
'updatedByUserId' : 'user-1',
}
}, {
'id' : '16e4d83d-a076-4175-a810-90190eb2954c',
'name' : 'University of Maryland, Baltimore',
'code' : 'umb',
'metadata' : {
'createdDate' : '2019-04-18T16:41:36.806+0000',
'createdByUserId' : 'user-2',
'updatedDate' : '2019-04-18T16:41:36.806+0000',
'updatedByUserId' : 'user-2',
}
}, {
'id' : '16e4d83d-a076-4175-a810-90190eb2954c',
'name' : 'Cornell University',
Expand Down

0 comments on commit 84ca693

Please sign in to comment.