mnemo_cards/mnemo_cards_backend/test/database/database_test.dart
Dmitry 3d179c95ef
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Admin Panel / Deploy Admin Panel (push) Waiting to run
Deploy Admin Panel / Admin Panel Verification (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
stuff
2025-12-17 03:41:47 +03:00

40 lines
1.2 KiB
Dart

import 'package:test/test.dart';
import 'package:mnemo_cards_backend/database/database.dart';
void main() {
group('Database Schema Tests', () {
test('AppDatabase can be instantiated', () {
// This test verifies that the database class can be created
// Actual connection will be tested with real PostgreSQL instance
expect(() => AppDatabase.connect(
host: 'localhost',
port: 5432,
database: 'test_db',
username: 'test_user',
password: 'test_pass',
), returnsNormally);
});
test('All tables are registered', () {
// Verify that all expected tables are in the database
final db = AppDatabase.connect(
host: 'localhost',
port: 5432,
database: 'test_db',
username: 'test_user',
password: 'test_pass',
);
// Check that DAOs are available
expect(db.userDao, isNotNull);
expect(db.packDao, isNotNull);
expect(db.testDao, isNotNull);
expect(db.paymentDao, isNotNull);
expect(db.subscriptionDao, isNotNull);
expect(db.taskDao, isNotNull);
expect(db.promoCodeDao, isNotNull);
expect(db.discountDao, isNotNull);
expect(db.statisticsDao, isNotNull);
});
});
}