diff --git a/templates/dart/test/channel_test.dart.twig b/templates/dart/test/channel_test.dart.twig deleted file mode 100644 index 4ebc5d1473..0000000000 --- a/templates/dart/test/channel_test.dart.twig +++ /dev/null @@ -1,154 +0,0 @@ -import 'package:{{ language.params.packageName }}/{{ language.params.packageName }}.dart'; -{% if 'dart' in language.params.packageName %} -import 'package:test/test.dart'; -{% else %} -import 'package:flutter_test/flutter_test.dart'; -{% endif %} - -void main() { - group('database()', () { - test('throws when database id is missing', () { - expect(() => Channel.database(''), throwsArgumentError); - }); - - test('returns database channel with specific ID', () { - final builder = Channel.database('db1'); - expect(builder.channel, 'databases.db1'); - }); - - test('returns database channel with collection and document', () { - final channel = Channel.database('db1').collection('col1').document(); - expect(channel.channel, 'databases.db1.collections.col1.documents'); - }); - - test('returns database channel with action', () { - final channel = Channel.database('db1').collection('col1').document('doc1').create(); - expect(channel.toString(), 'databases.db1.collections.col1.documents.doc1.create'); - }); - - test('returns database channel with upsert action', () { - final channel = Channel.database('db1').collection('col1').document('doc1').upsert(); - expect(channel.toString(), 'databases.db1.collections.col1.documents.doc1.upsert'); - }); - }); - - group('tablesdb()', () { - test('throws when tablesdb id is missing', () { - expect(() => Channel.tablesdb(''), throwsArgumentError); - }); - - test('returns tablesdb channel with specific ID', () { - final builder = Channel.tablesdb('db1'); - expect(builder.channel, 'tablesdb.db1'); - }); - - test('returns tablesdb channel with table and row', () { - final channel = Channel.tablesdb('db1').table('table1').row(); - expect(channel.channel, 'tablesdb.db1.tables.table1.rows'); - }); - - test('returns tablesdb channel with action', () { - final channel = Channel.tablesdb('db1').table('table1').row('row1').update(); - expect(channel.toString(), 'tablesdb.db1.tables.table1.rows.row1.update'); - }); - }); - - group('account()', () { - test('returns account channel', () { - expect(Channel.account(), 'account'); - }); - }); - - group('bucket()', () { - test('throws when bucket id is missing', () { - expect(() => Channel.bucket(''), throwsArgumentError); - }); - - test('returns buckets channel with specific ID', () { - final builder = Channel.bucket('bucket1'); - expect(builder.channel, 'buckets.bucket1'); - }); - - test('returns buckets channel with file', () { - final channel = Channel.bucket('bucket1').file(); - expect(channel.channel, 'buckets.bucket1.files'); - }); - - test('returns buckets channel with action', () { - final channel = Channel.bucket('bucket1').file('file1').delete(); - expect(channel.toString(), 'buckets.bucket1.files.file1.delete'); - }); - }); - - group('functions()', () { - test('throws when function id is missing', () { - expect(() => Channel.function(''), throwsArgumentError); - }); - - test('returns functions channel with specific ID', () { - final builder = Channel.function('func1'); - expect(builder.channel, 'functions.func1'); - }); - }); - - group('executions()', () { - test('throws when execution id is missing', () { - expect(() => Channel.execution(''), throwsArgumentError); - }); - - test('returns executions channel with specific ID', () { - final builder = Channel.execution('exec1'); - expect(builder.channel, 'executions.exec1'); - }); - }); - - group('teams()', () { - test('throws when team id is missing', () { - expect(() => Channel.team(''), throwsArgumentError); - }); - - test('returns teams channel with specific team ID', () { - final builder = Channel.team('team1'); - expect(builder.channel, 'teams.team1'); - }); - - test('returns teams channel with action', () { - final channel = Channel.team('team1').create(); - expect(channel.toString(), 'teams.team1.create'); - }); - }); - - group('memberships()', () { - test('throws when membership id is missing', () { - expect(() => Channel.membership(''), throwsArgumentError); - }); - - test('returns memberships channel with specific membership ID', () { - final builder = Channel.membership('membership1'); - expect(builder.channel, 'memberships.membership1'); - }); - - test('returns memberships channel with action', () { - final channel = Channel.membership('membership1').update(); - expect(channel.toString(), 'memberships.membership1.update'); - }); - }); - - group('global events', () { - test('returns documents channel', () { - expect(Channel.documents, 'documents'); - }); - - test('returns rows channel', () { - expect(Channel.rows, 'rows'); - }); - - test('returns files channel', () { - expect(Channel.files, 'files'); - }); - - test('returns executions channel', () { - expect(Channel.executions, 'executions'); - }); - }); -}