Skip to content

Commit

Permalink
feat: julkaise ja poista aineisto nähtäviltä sääntöjen mukaan (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
haapamakim committed Feb 16, 2023
1 parent a8dce19 commit e67eea7
Show file tree
Hide file tree
Showing 37 changed files with 739 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Array [
"FlexibleTimeWindow": Object {
"Mode": "OFF",
},
"GroupName": "***unittest***",
"Name": "P1-2-246-578-5-1-2978288874-2711575506-2031-01-01T00-00-00",
"ScheduleExpression": "at(2031-01-01T00:00:00)",
"ScheduleExpressionTimezone": "Europe/Helsinki",
Expand All @@ -227,6 +228,7 @@ Array [
exports[`AloitusKuulutuksen uudelleenkuuluttaminen should create uudelleenkuulutus for aloituskuulutus successfully 7`] = `
Object {
"args": Object {
"GroupName": "***unittest***",
"Name": "P1-2-246-578-5-1-2978288874-2711575506-2031-01-01T00-00-00",
},
"stub": "deleteSchedule",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,21 @@ describe("AloitusKuulutus", () => {
awsCloudfrontInvalidationStub = new CloudFrontStub();
});

afterEach(() => {
userFixture.logout();
sinon.restore();
});

beforeEach(async () => {
await setupLocalDatabase();
mockSaveProjektiToVelho();
userFixture = new UserFixture(userService);
});

afterEach(() => {
userFixture.logout();
sinon.reset();
});

after(() => {
sinon.restore();
});

it("should create and manipulate projekti successfully", async function () {
const projekti = new ProjektiFixture().dbProjekti1();
const oid = projekti.oid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as personSearchUpdaterHandler from "../../src/personSearch/lambda/perso
import { aloitusKuulutusTilaManager } from "../../src/handler/tila/aloitusKuulutusTilaManager";
import { fileService } from "../../src/files/fileService";
import { FixtureName, useProjektiTestFixture } from "../api/testFixtureRecorder";
import { CloudFrontStub, defaultMocks, EmailClientStub, PDFGeneratorStub, SchedulerMock } from "../api/testUtil/util";
import { CloudFrontStub, defaultMocks, EmailClientStub, PDFGeneratorStub } from "../api/testUtil/util";
import { testPublicAccessToProjekti, testYllapitoAccessToProjekti } from "../api/testUtil/tests";
import { api } from "../api/apiClient";
import assert from "assert";
Expand All @@ -37,12 +37,10 @@ describe("AloitusKuulutuksen uudelleenkuuluttaminen", () => {
const emailClientStub = new EmailClientStub();
const pdfGeneratorStub = new PDFGeneratorStub();
let importAineistoMock: ImportAineistoMock;
let schedulerMock: SchedulerMock;
let awsCloudfrontInvalidationStub: CloudFrontStub;
defaultMocks();
const { schedulerMock } = defaultMocks();

before(async () => {
schedulerMock = new SchedulerMock();
readUsersFromSearchUpdaterLambda = sinon.stub(personSearchUpdaterClient, "readUsersFromSearchUpdaterLambda");
readUsersFromSearchUpdaterLambda.callsFake(async () => {
return await personSearchUpdaterHandler.handleEvent();
Expand All @@ -66,6 +64,9 @@ describe("AloitusKuulutuksen uudelleenkuuluttaminen", () => {
afterEach(() => {
userFixture.logout();
sinon.reset();
});

after(() => {
sinon.restore();
});

Expand Down
Loading

0 comments on commit e67eea7

Please sign in to comment.