Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/luxon-3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrosx authored Mar 7, 2023
2 parents 47faae1 + cdc02ad commit 6efb2fe
Show file tree
Hide file tree
Showing 2 changed files with 492 additions and 2 deletions.
42 changes: 40 additions & 2 deletions test/DatasetAuthorization.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const sandbox = require("sinon").createSandbox();
let accessTokenIngestor = null,
accessTokenUser1 = null,
accessTokenUser2 = null,
accessTokenUser3 = null;
accessTokenUser3 = null,
accessTokenArchiveManager = null;

let datasetPid1 = null,
encodedDatasetPid1 = null,
Expand Down Expand Up @@ -72,7 +73,17 @@ describe("DatasetAuthorization: Test access to dataset", () => {
},
(tokenVal) => {
accessTokenUser3 = tokenVal;
done();
utils.getToken(
appUrl,
{
username: "archiveManager",
password: "aman",
},
(tokenVal) => {
accessTokenArchiveManager = tokenVal;
done();
},
);
},
);
},
Expand Down Expand Up @@ -595,4 +606,31 @@ describe("DatasetAuthorization: Test access to dataset", () => {
.expect("Content-Type", /json/)
.expect(200);
});

it("should delete dataset 1", async () => {
return request(appUrl)
.delete("/api/v3/datasets/" + encodedDatasetPid1)
.set("Accept", "application/json")
.set({ Authorization: `Bearer ${accessTokenArchiveManager}` })
.expect(200)
.expect("Content-Type", /json/);
});

it("should delete dataset 2", async () => {
return request(appUrl)
.delete("/api/v3/datasets/" + encodedDatasetPid2)
.set("Accept", "application/json")
.set({ Authorization: `Bearer ${accessTokenArchiveManager}` })
.expect(200)
.expect("Content-Type", /json/);
});

it("should delete dataset 3", async () => {
return request(appUrl)
.delete("/api/v3/datasets/" + encodedDatasetPid3)
.set("Accept", "application/json")
.set({ Authorization: `Bearer ${accessTokenArchiveManager}` })
.expect(200)
.expect("Content-Type", /json/);
});
});
Loading

0 comments on commit 6efb2fe

Please sign in to comment.