Skip to content

Commit 42025bc

Browse files
fix tests
1 parent d0070c8 commit 42025bc

File tree

2 files changed

+26
-28
lines changed

2 files changed

+26
-28
lines changed

src/MarcRoute/MarcRoute.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const renderMarcRoute = ({ history, ...props } = {}) => (render(
4040
describe('Given Quick Marc', () => {
4141
beforeEach(() => {
4242
useUserTenantPermissions.mockReturnValue({
43-
userPermissions: [],
43+
userPermissions: new Set(),
4444
isFetching: false,
4545
});
4646

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

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

5654
useUserTenantPermissions.mockReturnValue({
5755
userPermissions,

src/QuickMarcEditor/QuickMarcEditorContainer.test.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,16 @@ describe('Given Quick Marc Editor Container', () => {
282282
});
283283
});
284284

285-
recordLengthField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.Record length' });
286-
statusField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Status' });
287-
typeField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Type' });
288-
blvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.BLvl' });
289-
ctrlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Ctrl' });
290-
positions9to16Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.9-16 positions' });
291-
elvlField = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.tip.ELvl' });
292-
descField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.Desc' });
293-
multiLvlField = screen.getByRole('combobox', { name: 'ui-quick-marc.record.fixedField.tip.MultiLvl' });
294-
positions20to23Field = screen.getByRole('textbox', { name: 'ui-quick-marc.record.fixedField.20-23 positions' });
285+
recordLengthField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.Record length/ });
286+
statusField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Status/ });
287+
typeField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Type/ });
288+
blvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.BLvl/ });
289+
ctrlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Ctrl/ });
290+
positions9to16Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.9-16 positions/ });
291+
elvlField = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.tip.ELvl/ });
292+
descField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.Desc/ });
293+
multiLvlField = screen.getByRole('combobox', { name: /ui-quick-marc.record.fixedField.tip.MultiLvl/ });
294+
positions20to23Field = screen.getByRole('textbox', { name: /ui-quick-marc.record.fixedField.20-23 positions/ });
295295
});
296296

297297
it('should display correct default values', () => {
@@ -408,13 +408,13 @@ describe('Given Quick Marc Editor Container', () => {
408408
});
409409
});
410410

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

420420
it('should display correct default values', () => {
@@ -492,13 +492,13 @@ describe('Given Quick Marc Editor Container', () => {
492492
});
493493
});
494494

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

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

0 commit comments

Comments
 (0)