Skip to content

Commit

Permalink
test: improve e2e tests further
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianfrey committed Oct 30, 2023
1 parent 793e5b2 commit b7232a7
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/processes/test/e2e/processes.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('e2e: getProcess() should return a process', async () => {
expect(process.title).toBeTruthy();
});

test('e2e: executeJob() should execute job synchronously', async () => {
test('e2e: executeJob({ mode: sync }) should execute job synchronously', async () => {
const service = new ProcessesService({ baseUrl: TEST_SITE });
const result = await service.executeProcess('hello-world', {
mode: 'sync',
Expand All @@ -54,7 +54,7 @@ test('e2e: executeJob() should execute job synchronously', async () => {
});

// TODO: check again when https://github.com/geopython/pygeoapi/discussions/1383#discussioncomment-7421781 is resolved
/* test('e2e: executeJob() should execute job asynchronously', async () => {
/* test('e2e: executeJob({ mode: async }) should execute job asynchronously', async () => {
const service = new ProcessesService({ baseUrl: TEST_SITE });
const result = await service.executeProcess('hello-world', {
mode: 'async',
Expand All @@ -79,4 +79,18 @@ test('e2e: getJobs() should return a jobs list', async () => {
const result = await service.getJobs();

expect(Array.isArray(result.jobs)).toBe(true);
result.jobs.forEach((job) => {
expect(job.processID).toBe('hello-world');
expect(job.status).toBe('successful');
})
});

test('e2e: getJob() should return a job', async () => {
const service = new ProcessesService({ baseUrl: TEST_SITE });
const result = await service.getJob('f78fa304-775f-11ee-88b4-0242ac110002');

expect(result).toBeDefined();
expect(result.processID).toBe('hello-world');
expect(result.status).toBe('successful');
expect(result.jobID).toBe('f78fa304-775f-11ee-88b4-0242ac110002');
});

0 comments on commit b7232a7

Please sign in to comment.