Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spitfire ECS BF fixes 1/24 #4669

Merged
merged 2 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import moment from 'moment';
import { calloutTypes } from '../../../../../../interactors';
import { getTestEntityValue } from '../../../../../support/utils/stringTools';
import ConsortiumManagerApp, {
Expand Down Expand Up @@ -120,12 +119,6 @@ describe('Consortia', () => {
name: alternativeTitleTypes4.name,
});
ConsortiaControlledVocabularyPaneset.clickSave();
const rowDataToCheck = [
alternativeTitleTypes4.name,
'consortium',
moment().format('l'),
'All',
];

ConfirmShare.waitLoadingConfirmShareToAll(alternativeTitleTypes4.name);
ConfirmShare.clickConfirm();
Expand All @@ -135,10 +128,10 @@ describe('Consortia', () => {
messages.noPermission(tenantNames.college),
calloutTypes.error,
);
ConsortiaControlledVocabularyPaneset.verifyRecordInTheList(alternativeTitleTypes4.name, [
'edit',
'trash',
]);
ConsortiaControlledVocabularyPaneset.verifyRecordInTheList(
alternativeTitleTypes4.name,
['edit', 'trash'],
);

ConsortiaControlledVocabularyPaneset.createViaUi(true, alternativeTitleTypes5);
ConsortiaControlledVocabularyPaneset.clickSave();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import moment from 'moment';
import { calloutTypes } from '../../../../../../interactors';
import { getTestEntityValue } from '../../../../../support/utils/stringTools';
import ConsortiumManagerApp, {
Expand Down Expand Up @@ -123,12 +122,6 @@ describe('Consortia', () => {
name: classificationType4.name,
});
ConsortiaControlledVocabularyPaneset.clickSave();
const createdCIT = [
classificationType4.name,
'consortium',
moment().format('l'),
'All',
];

ConfirmShare.waitLoadingConfirmShareToAll(classificationType4.name);
ConfirmShare.clickConfirm();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import moment from 'moment';
import { calloutTypes } from '../../../../../../interactors';
import { getTestEntityValue } from '../../../../../support/utils/stringTools';
import ConsortiumManagerApp, {
Expand Down Expand Up @@ -115,7 +114,6 @@ describe('Consortia', () => {
name: instanceNote4.name,
});
ConsortiaControlledVocabularyPaneset.clickSave();
const createdCIT = [instanceNote4.name, 'consortium', moment().format('l'), 'All'];

ConfirmShare.waitLoadingConfirmShareToAll(instanceNote4.name);
ConfirmShare.clickConfirm();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import moment from 'moment';
import { calloutTypes } from '../../../../../../interactors';
import { getTestEntityValue } from '../../../../../support/utils/stringTools';
import ConsortiumManagerApp, {
Expand Down Expand Up @@ -115,7 +114,6 @@ describe('Consortia', () => {
name: modesIssuance4.name,
});
ConsortiaControlledVocabularyPaneset.clickSave();
const createdCIT = [modesIssuance4.name, 'consortium', moment().format('l'), 'All'];

ConfirmShare.waitLoadingConfirmShareToAll(modesIssuance4.name);
ConfirmShare.clickConfirm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ describe('Data Import', () => {
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex);
});
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
})
.then(() => {
Expand All @@ -235,23 +237,27 @@ describe('Data Import', () => {
.then(() => {
// adding Holdings in College for shared Instance
cy.setTenant(Affiliations.College);
const collegeLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: createdAuthorityIDs[0],
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
testData.collegeHoldings.push(holding);
InventoryHoldings.getHoldingsFolioSource().then((folioSource) => {
const universityHoldingsSourceId = folioSource.id;
const collegeLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: createdAuthorityIDs[0],
permanentLocationId: testData.collegeLocation.id,
sourceId: universityHoldingsSourceId,
}).then((holding) => {
testData.collegeHoldings.push(holding);
});
});
});

cy.resetTenant();
cy.login(testData.userProperties.username, testData.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
cy.resetTenant();
cy.login(testData.userProperties.username, testData.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ describe('Data Import', () => {
QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex);
});
QuickMarcEditor.pressSaveAndClose();
cy.wait(1500);
QuickMarcEditor.pressSaveAndClose();
QuickMarcEditor.checkAfterSaveAndClose();
})
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,67 +72,76 @@ describe('Inventory', () => {
testData.contributorTypeName = contributorTypes[0].name;

cy.setTenant(Affiliations.College);
InventoryInstance.createInstanceViaApi({
instanceTitle: testData.localInstanceTitle,
}).then((body) => {
cy.getInstanceById(body.instanceData.instanceId).then((body2) => {
const requestBodyLocal = body2;
requestBodyLocal.contributors = [
{
name: `${contributorPrefix} 1`,
contributorNameTypeId: contributorNameTypes[0].id,
contributorTypeId: contributorTypes[0].id,
contributorTypeText: '',
primary: false,
},
{
name: `${contributorPrefix} 2`,
contributorNameTypeId: contributorNameTypes[0].id,
contributorTypeId: contributorTypes[0].id,
contributorTypeText: '',
primary: false,
},
];
cy.updateInstance(requestBodyLocal);
});
testData.localInstanceId = body.instanceData.instanceId;

// adding Holdings in College for shared Instance
cy.setTenant(Affiliations.College);
const collegeLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.sharedInstanceId,
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
testData.collegeHoldings.push(holding);
InventoryHoldings.getHoldingsFolioSource().then((folioSource) => {
const collegeHoldingsSourceId = folioSource.id;
InventoryInstance.createInstanceViaApi({
instanceTitle: testData.localInstanceTitle,
}).then((body) => {
cy.getInstanceById(body.instanceData.instanceId).then((body2) => {
const requestBodyLocal = body2;
requestBodyLocal.contributors = [
{
name: `${contributorPrefix} 1`,
contributorNameTypeId: contributorNameTypes[0].id,
contributorTypeId: contributorTypes[0].id,
contributorTypeText: '',
primary: false,
},
{
name: `${contributorPrefix} 2`,
contributorNameTypeId: contributorNameTypes[0].id,
contributorTypeId: contributorTypes[0].id,
contributorTypeText: '',
primary: false,
},
];
cy.updateInstance(requestBodyLocal);
});
testData.localInstanceId = body.instanceData.instanceId;

// adding Holdings in College for local Instance
// adding Holdings in College for shared Instance
cy.setTenant(Affiliations.College);
const collegeLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.localInstanceId,
instanceId: testData.sharedInstanceId,
permanentLocationId: testData.collegeLocation.id,
}).then((holding2) => {
testData.collegeHoldings.push(holding2);
sourceId: collegeHoldingsSourceId,
}).then((holding) => {
testData.collegeHoldings.push(holding);

// adding Holdings in College for local Instance
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.localInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: collegeHoldingsSourceId,
}).then((holding2) => {
testData.collegeHoldings.push(holding2);
});
});
});
});
});

// adding Holdings in University for shared Instance
cy.setTenant(Affiliations.University);
const universityLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(universityLocationData).then((location) => {
testData.universityLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.sharedInstanceId,
permanentLocationId: location.id,
}).then((holding) => {
testData.universityHoldings.push(holding);
InventoryHoldings.getHoldingsFolioSource().then((folioSource) => {
const universityHoldingsSourceId = folioSource.id;
const universityLocationData = Locations.getDefaultLocation({
servicePointId: ServicePoints.getDefaultServicePoint().id,
}).location;
Locations.createViaApi(universityLocationData).then((location) => {
testData.universityLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.sharedInstanceId,
permanentLocationId: location.id,
sourceId: universityHoldingsSourceId,
}).then((holding) => {
testData.universityHoldings.push(holding);
});
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,24 +235,29 @@ describe('Inventory', () => {
// 1 Local "Instance" record with source = "MARC" should have "Holdings" records created on Member 1 tenant

cy.setTenant(Affiliations.College);

InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId,
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[1],
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[1].createdRecordsId[0],
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
InventoryHoldings.getHoldingsFolioSource().then((folioSource) => {
const collegeHoldingsSourceId = folioSource.id;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[1].testInstanceId,
permanentLocationId: testData.collegeLocation.id,
sourceId: collegeHoldingsSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[1],
permanentLocationId: testData.collegeLocation.id,
sourceId: collegeHoldingsSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[1].createdRecordsId[0],
permanentLocationId: testData.collegeLocation.id,
sourceId: collegeHoldingsSourceId,
}).then((holding) => {
createdHoldingsCollege.push(holding.id);
});
});
})
.then(() => {
Expand All @@ -261,24 +266,29 @@ describe('Inventory', () => {
// 1 Local "Instance" record with source = "MARC" should have "Holdings" records created on Member 2 tenant

cy.setTenant(Affiliations.University);

InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[2].testInstanceId,
permanentLocationId: testData.universityLocation.id,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[2],
permanentLocationId: testData.universityLocation.id,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[2].createdRecordsId[0],
permanentLocationId: testData.universityLocation.id,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
InventoryHoldings.getHoldingsFolioSource().then((folioSource) => {
const universityHoldingsSourceId = folioSource.id;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: sharedFOLIOInstancesFromCentral[2].testInstanceId,
permanentLocationId: testData.universityLocation.id,
sourceId: universityHoldingsSourceId,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[0].createdRecordsId[2],
permanentLocationId: testData.universityLocation.id,
sourceId: universityHoldingsSourceId,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
InventoryHoldings.createHoldingRecordViaApi({
instanceId: marcFiles[2].createdRecordsId[0],
permanentLocationId: testData.universityLocation.id,
sourceId: universityHoldingsSourceId,
}).then((holding) => {
createdHoldingsUniversity.push(holding.id);
});
});
});

Expand Down
Loading
Loading