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 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
43 lines
1.3 KiB
Dart
43 lines
1.3 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);
|
|
});
|
|
});
|
|
}
|