Added test project requiring mongodb and added new workflow to test Gitea Actions - Service Containers

This commit is contained in:
2023-07-17 16:39:34 +02:00
parent e833c393fb
commit 5c635fd321
12 changed files with 1650 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
// @ts-check
import { test, expect } from '@playwright/test';
test('event creation', async ({ request }) => {
const testTitle = 'Test event';
const response = await request.post('/', {
data: {
title: testTitle,
},
});
expect(response.ok()).toBeTruthy();
const resDataRaw = await response.body();
const resData = JSON.parse(resDataRaw.toString());
expect(resData).toHaveProperty('event.id');
expect(resData.event.title).toBe(testTitle);
});
test('getting events', async ({ request }) => {
const response = await request.get('/');
expect(response.ok()).toBeTruthy();
const resDataRaw = await response.body();
const resData = JSON.parse(resDataRaw.toString());
expect(resData).toHaveProperty('events');
expect(resData.events.length).toBeGreaterThan(0);
});