Skip to content

Commit

Permalink
Merge branch 'master' into eureka-test-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
zentestuken committed Jan 14, 2025
2 parents a0bb10f + 375eebf commit 0b398bf
Show file tree
Hide file tree
Showing 26 changed files with 1,418 additions and 122 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import permissions from '../../../support/dictionary/permissions';
import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions';
import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane';
import ExportFile from '../../../support/fragments/data-export/exportFile';
import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files';
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView';
Expand All @@ -10,7 +10,11 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import Users from '../../../support/fragments/users/users';
import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import { ITEM_NOTES, MATERIAL_TYPE_IDS } from '../../../support/constants';
import {
BULK_EDIT_TABLE_COLUMN_HEADERS,
ITEM_NOTES,
MATERIAL_TYPE_IDS,
} from '../../../support/constants';

let user;

Expand Down Expand Up @@ -99,11 +103,30 @@ describe('bulk-edit', () => {
BulkEditSearchPane.waitFileUploading();
BulkEditSearchPane.verifyMatchedResults(item.barcode);
BulkEditActions.downloadMatchedResults();
ExportFile.verifyFileIncludes(matchedRecordsFileName, [
`,${notes.admin},dvd,`,
`,${notes.copy},${notes.electronicBookplate}`,
`,${notes.checkIn},${notes.checkOut},`,
]);
BulkEditFiles.verifyHeaderValueInRowByIdentifier(
matchedRecordsFileName,
BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE,
item.barcode,
[
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE,
value: notes.admin,
},
{ header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE, value: notes.copy },
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE,
value: notes.electronicBookplate,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE,
value: notes.checkIn,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE,
value: notes.checkOut,
},
],
);
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet(
'Administrative note',
'Copy note',
Expand All @@ -128,11 +151,37 @@ describe('bulk-edit', () => {
notes.electronicBookplate,
]);
BulkEditActions.downloadPreview();
ExportFile.verifyFileIncludes(previewFileName, [
',,dvd,',
`,${notes.action},,,`,
'Available,,,',
]);

const editedHeaderValues = [
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE,
value: '',
},
{ header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE, value: '' },
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE,
value: notes.electronicBookplate,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE,
value: '',
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE,
value: '',
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ACTION_NOTE,
value: notes.action,
},
];

BulkEditFiles.verifyHeaderValueInRowByIdentifier(
previewFileName,
BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE,
item.barcode,
editedHeaderValues,
);
BulkEditActions.commitChanges();
BulkEditSearchPane.waitFileUploading();
BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', '');
Expand All @@ -146,11 +195,13 @@ describe('bulk-edit', () => {
BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', '');
BulkEditActions.openActions();
BulkEditActions.downloadChangedCSV();
ExportFile.verifyFileIncludes(changedRecordsFileName, [
',,dvd,',
`,${notes.action},,,`,
'Available,,,',
]);

BulkEditFiles.verifyHeaderValueInRowByIdentifier(
changedRecordsFileName,
BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE,
item.barcode,
editedHeaderValues,
);

TopMenuNavigation.navigateToApp('Inventory');
InventorySearchAndFilter.switchToItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ import FileManager from '../../../support/utils/fileManager';
import getRandomPostfix from '../../../support/utils/stringTools';
import ExportFile from '../../../support/fragments/data-export/exportFile';
import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView';
import { APPLICATION_NAMES, ITEM_NOTES, MATERIAL_TYPE_IDS } from '../../../support/constants';
import {
APPLICATION_NAMES,
BULK_EDIT_TABLE_COLUMN_HEADERS,
ITEM_NOTES,
MATERIAL_TYPE_IDS,
} from '../../../support/constants';
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation';
import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files';

let user;
const item = {
Expand Down Expand Up @@ -163,12 +169,11 @@ describe('bulk-edit', () => {
BulkEditActions.confirmChanges();
BulkEditActions.verifyAreYouSureForm(1, item.itemBarcode);
BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin);
// TODO: uncomment after MODBULKOPS-204
// BulkEditSearchPane.verifyExactChangesUnderColumns(
// 'Check out note',
// `${notes.checkOut} (staff only)`,
// );
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn);
BulkEditSearchPane.verifyExactChangesUnderColumns(
'Check out note',
`${notes.checkOut} (staff only)`,
);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn);
BulkEditSearchPane.verifyExactChangesUnderColumns('Action note', notes.action);
BulkEditSearchPane.verifyExactChangesUnderColumns(
'Binding note',
Expand Down Expand Up @@ -198,12 +203,11 @@ describe('bulk-edit', () => {
BulkEditActions.confirmChanges();
BulkEditActions.verifyAreYouSureForm(1, item.itemBarcode);
BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin);
// TODO: uncomment after MODBULKOPS-204
// BulkEditSearchPane.verifyExactChangesUnderColumns(
// 'Check out note',
// `${notes.checkOut} (staff only)`,
// );
// BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn);
BulkEditSearchPane.verifyExactChangesUnderColumns(
'Check out note',
`${notes.checkOut} (staff only)`,
);
BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn);
BulkEditSearchPane.verifyExactChangesUnderColumns('Action note', notes.action);
BulkEditSearchPane.verifyExactChangesUnderColumns(
'Binding note',
Expand All @@ -221,21 +225,66 @@ describe('bulk-edit', () => {
`${notes.reproduction} (staff only)`,
);
BulkEditActions.downloadPreview();
ExportFile.verifyFileIncludes(previewFileName, [
`${notes.action},${notes.binding} (staff only),${notes.copy} (staff only),,${notes.note} (staff only),${notes.provenance},${notes.reproduction} (staff only)`,
`Available,${notes.checkIn},${notes.checkOut} (staff only),`,
`,${notes.admin},dvd,`,
]);

const addedNoteHeaderValues = [
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE,
value: notes.admin,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.PROVENANCE_NOTE,
value: notes.provenance,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.REPRODUCTION_NOTE,
value: `${notes.reproduction} (staff only)`,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.NOTE,
value: `${notes.note} (staff only)`,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ACTION_NOTE,
value: notes.action,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BINDING_NOTE,
value: `${notes.binding} (staff only)`,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE,
value: `${notes.copy} (staff only)`,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE,
value: '',
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE,
value: notes.checkIn,
},
{
header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE,
value: `${notes.checkOut} (staff only)`,
},
];
BulkEditFiles.verifyHeaderValueInRowByIdentifier(
previewFileName,
BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE,
item.itemBarcode,
addedNoteHeaderValues,
);
BulkEditActions.commitChanges();
BulkEditSearchPane.waitFileUploading();
BulkEditActions.openActions();
BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Check out note', 'Check in note');
BulkEditActions.downloadChangedCSV();
ExportFile.verifyFileIncludes(changedRecordsFileName, [
`${notes.action},${notes.binding} (staff only),${notes.copy} (staff only),,${notes.note} (staff only),${notes.provenance},${notes.reproduction} (staff only)`,
`Available,${notes.checkIn},${notes.checkOut} (staff only),`,
`,${notes.admin},dvd,`,
]);
BulkEditFiles.verifyHeaderValueInRowByIdentifier(
changedRecordsFileName,
BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE,
item.itemBarcode,
addedNoteHeaderValues,
);
BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin);
BulkEditSearchPane.verifyExactChangesUnderColumns(
'Check out note',
Expand Down
Loading

0 comments on commit 0b398bf

Please sign in to comment.