공개페이지 완료

This commit is contained in:
2025-11-10 14:14:08 +09:00
parent 2ce0b81483
commit ac43ddb55e
67 changed files with 3220 additions and 224696 deletions
@@ -45,7 +45,7 @@ class FakeEventService extends ChangeNotifier implements EventService {
@override
Future<Event> updateEvent(String eventId, Map<String, dynamic> eventData) async {
// ignore: avoid_print
print('FakeEventService.updateEvent called for ' + eventId);
print('FakeEventService.updateEvent called for $eventId');
lastUpdateEventId = eventId;
lastUpdatePayload = Map<String, dynamic>.from(eventData);
return Event(
@@ -189,7 +189,7 @@ void main() {
expect(payload, isNotNull);
// debug
// ignore: avoid_print
print('Update payload: ' + payload.toString());
print('Update payload: $payload');
expect(payload!['title'], '수정된 이벤트');
expect(payload['description'], '수정 설명');
@@ -1,4 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:lanebow/models/event_model.dart';
@@ -77,7 +77,7 @@ void main() {
final data = await svc.enter(hash, password: 'pw');
expect(data['token'], 'TKN');
expect(WebStorage.getItem(PublicEventService.tokenKey(hash)), 'TKN');
expect(fake.lastPath, '/api/public/' + hash);
expect(fake.lastPath, '/api/public/$hash');
});
test('removes saved token on 401/403', () async {
@@ -115,7 +115,7 @@ void main() {
handicap: 0,
);
expect(fake.lastPath, '/api/public/' + hash + '/score');
expect(fake.lastPath, '/api/public/$hash/score');
expect(fake.lastHeaders?['Authorization'], 'Bearer TKN2');
expect(fake.lastData['participantId'], '10');
expect(fake.lastData['gameNumber'], 1);
@@ -134,7 +134,7 @@ void main() {
final data = await svc.fetchEvent(hash);
expect(data['event']['id'], 'E1');
expect(fake.lastPath, '/api/public/' + hash);
expect(fake.lastPath, '/api/public/$hash');
expect(fake.lastHeaders?['Authorization'], 'Bearer TKF');
});
});
@@ -162,7 +162,7 @@ void main() {
WebStorage.setItem(PublicEventService.tokenKey(hash), 'TG');
await svc.addGuest(hash, name: '홍길동', phone: '010', gender: 'M', average: 190);
expect(fake.lastPath, '/api/public/' + hash + '/guest');
expect(fake.lastPath, '/api/public/$hash/guest');
expect(fake.lastHeaders?['Authorization'], 'Bearer TG');
expect(fake.lastData['name'], '홍길동');
expect(fake.lastData['phone'], '010');
@@ -14,7 +14,7 @@ DioException dio404(String path) => DioException(
class Stub404Service extends PublicEventService {
@override
Future<Map<String, dynamic>> fetchEvent(String publicHash) async {
throw dio404('/api/public/' + publicHash);
throw dio404('/api/public/$publicHash');
}
}
@@ -14,7 +14,7 @@ DioException dio401(String path) => DioException(
class StubFetch401Service extends PublicEventService {
@override
Future<Map<String, dynamic>> fetchEvent(String publicHash) async {
throw dio401('/api/public/' + publicHash);
throw dio401('/api/public/$publicHash');
}
}
@@ -37,7 +37,7 @@ class StubUpdate401Service extends PublicEventService {
@override
Future<void> updateScore(String publicHash, {required String participantId, required int gameNumber, required int score, int? handicap, dynamic teamNumber}) async {
throw dio401('/api/public/' + publicHash + '/score');
throw dio401('/api/public/$publicHash/score');
}
}