feat: harden content workflows and staging smoke tests
CI — Test & Build / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI — Test & Build / 🏗️ Build Docker Image (push) Blocked by required conditions
CI — Test & Build / 🐳 Docker integration & API E2E (push) Blocked by required conditions
CI — Test & Build / 🌐 Staging Playwright smoke (push) Waiting to run
CI — Test & Build / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI — Test & Build / 🏗️ Build Docker Image (push) Blocked by required conditions
CI — Test & Build / 🐳 Docker integration & API E2E (push) Blocked by required conditions
CI — Test & Build / 🌐 Staging Playwright smoke (push) Waiting to run
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
* These tests run against the real services in the Docker stack
|
||||
*/
|
||||
|
||||
import { MongoClient } from 'mongodb'
|
||||
import { MongoClient, ObjectId } from 'mongodb'
|
||||
|
||||
const DOCKER_SERVICES = {
|
||||
app: 'http://localhost:3000',
|
||||
app: 'http://localhost:8080',
|
||||
mongoExpress: 'http://localhost:8081',
|
||||
grafana: 'http://localhost:3001',
|
||||
loki: 'http://localhost:3100',
|
||||
mongodb: 'mongodb://admin:password123@localhost:27017/admin'
|
||||
mongodb: 'mongodb://admin:password123@localhost:27018/mozdit?authSource=admin'
|
||||
}
|
||||
|
||||
describe('Docker Environment Integration Tests', () => {
|
||||
@@ -170,6 +170,24 @@ describe('Docker Environment Integration Tests', () => {
|
||||
if (response.status === 200) {
|
||||
expect(result).toHaveProperty('message', 'Üzenet sikeresen elküldve!')
|
||||
expect(result).toHaveProperty('timestamp')
|
||||
expect(result).toHaveProperty('submissionId')
|
||||
|
||||
if (!mongoClient) {
|
||||
mongoClient = new MongoClient(DOCKER_SERVICES.mongodb)
|
||||
await mongoClient.connect()
|
||||
}
|
||||
const savedSubmission = await mongoClient
|
||||
.db('mozdit')
|
||||
.collection('contact_submissions')
|
||||
.findOne({ _id: new ObjectId(result.submissionId) })
|
||||
expect(savedSubmission).toEqual(expect.objectContaining({
|
||||
name: contactData.name,
|
||||
email: contactData.email,
|
||||
subject: contactData.subject,
|
||||
message: contactData.message,
|
||||
gdprConsent: true,
|
||||
status: 'new',
|
||||
}))
|
||||
} else {
|
||||
expect(result).toHaveProperty('error')
|
||||
expect(result.error).toContain('Túl sok')
|
||||
|
||||
Reference in New Issue
Block a user