Skip to content

Commit

Permalink
added test (#3109)
Browse files Browse the repository at this point in the history
  • Loading branch information
TetianaParanich committed Jan 23, 2024
1 parent 5e927ca commit a247ba2
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import { JOB_STATUS_NAMES } from '../../../../support/constants';

describe('Inventory', () => {
describe('Instance', () => {
let user;
const C402335testData = {
filePath: 'oneMarcBib.mrc',
marcFileName: `C402335 autotestFileName ${getRandomPostfix()}`,
marcFileName: `C402335 autotestFileName${getRandomPostfix()}`,
instanceIds: [],
instanceSource: 'MARC',
};
Expand All @@ -42,19 +43,19 @@ describe('Inventory', () => {

cy.createTempUser([Permissions.uiInventoryViewInstances.gui])
.then((userProperties) => {
C402335testData.user = userProperties;
user = userProperties;
})
.then(() => {
cy.assignAffiliationToUser(Affiliations.College, C402335testData.user.userId);
cy.assignAffiliationToUser(Affiliations.College, user.userId);
cy.setTenant(Affiliations.College);
cy.assignPermissionsToExistingUser(C402335testData.user.userId, [
cy.assignPermissionsToExistingUser(user.userId, [
Permissions.uiInventoryViewCreateEditInstances.gui,
]);
});
});

beforeEach('Login', () => {
cy.login(C402335testData.user.username, C402335testData.user.password, {
cy.login(user.username, user.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
Expand All @@ -67,7 +68,7 @@ describe('Inventory', () => {
cy.getAdminToken();
InventoryInstance.deleteInstanceViaApi(C402335testData.instanceIds[0]);
InventoryInstance.deleteInstanceViaApi(C402376testData.instance.instanceId);
Users.deleteViaApi(C402335testData.user.userId);
Users.deleteViaApi(user.userId);
});

it(
Expand Down

0 comments on commit a247ba2

Please sign in to comment.