Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Nov 25, 2024
1 parent d0070c8 commit 42025bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
6 changes: 2 additions & 4 deletions src/MarcRoute/MarcRoute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const renderMarcRoute = ({ history, ...props } = {}) => (render(
describe('Given Quick Marc', () => {
beforeEach(() => {
useUserTenantPermissions.mockReturnValue({
userPermissions: [],
userPermissions: new Set(),
isFetching: false,
});

Expand All @@ -49,9 +49,7 @@ describe('Given Quick Marc', () => {

describe('when a member tenant edits shared record', () => {
it('should fetch the central tenant permissions', () => {
const userPermissions = [{
permissionName: 'ui-quick-marc.quick-marc-editor.all',
}];
const userPermissions = new Set(['ui-quick-marc.quick-marc-editor.all']);

useUserTenantPermissions.mockReturnValue({
userPermissions,
Expand Down
48 changes: 24 additions & 24 deletions src/QuickMarcEditor/QuickMarcEditorContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,16 @@ describe('Given Quick Marc Editor Container', () => {
});
});

recordLengthField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.Record length' });
statusField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Status' });
typeField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Type' });
blvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.BLvl' });
ctrlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Ctrl' });
positions9to16Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.9-16 positions' });
elvlField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.tip.ELvl' });
descField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Desc' });
multiLvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.MultiLvl' });
positions20to23Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.20-23 positions' });
recordLengthField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.Record length/ });
statusField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Status/ });
typeField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Type/ });
blvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.BLvl/ });
ctrlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Ctrl/ });
positions9to16Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.9-16 positions/ });
elvlField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.tip.ELvl/ });
descField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Desc/ });
multiLvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.MultiLvl/ });
positions20to23Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.20-23 positions/ });
});

it('should display correct default values', () => {
Expand Down Expand Up @@ -408,13 +408,13 @@ describe('Given Quick Marc Editor Container', () => {
});
});

recordLengthField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.Record length' });
statusField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Status' });
typeField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Type' });
positions7to16Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.7-16 positions' });
elvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.ELvl' });
punctField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Punct' });
positions19to23Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.19-23 positions' });
recordLengthField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.Record length/ });
statusField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Status/ });
typeField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Type/ });
positions7to16Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.7-16 positions/ });
elvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.ELvl/ });
punctField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Punct/ });
positions19to23Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.19-23 positions/ });
});

it('should display correct default values', () => {
Expand Down Expand Up @@ -492,13 +492,13 @@ describe('Given Quick Marc Editor Container', () => {
});
});

recordLengthField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.Record length' });
statusField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Status' });
typeField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Type' });
positions7to16Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.7-16 positions' });
elvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.ELvl' });
itemField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Item' });
positions19to23Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.19-23 positions' });
recordLengthField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.Record length/ });
statusField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Status/ });
typeField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Type/ });
positions7to16Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.7-16 positions/ });
elvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.ELvl/ });
itemField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Item/ });
positions19to23Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.19-23 positions/ });
});

it('should display correct default values', async () => {
Expand Down

0 comments on commit 42025bc

Please sign in to comment.