끝난 이클립스 합류 문구 · HOME 헤더 POP · 다국어 HOME 레이아웃 · 캠페인 표시 수정
This commit is contained in:
@@ -267,6 +267,28 @@ void main() {
|
||||
expect(find.widgetWithText(FilledButton, '기여하기'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('모금 중이 아닌 타인 캠페인(달성 · 미달 환불 · 결과보고 · 취소)에는 기여하기 버튼이 없다(10/8 r11)', (tester) async {
|
||||
for (final (status, shown) in [
|
||||
(CampaignStatus.funding, findsOneWidget),
|
||||
(CampaignStatus.success, findsNothing),
|
||||
(CampaignStatus.failed, findsNothing),
|
||||
(CampaignStatus.reported, findsNothing),
|
||||
(CampaignStatus.cancelled, findsNothing),
|
||||
]) {
|
||||
await pumpWide(
|
||||
tester,
|
||||
CampaignDetailScreen(
|
||||
key: ValueKey(status),
|
||||
campaignId: 'c1',
|
||||
repository: _Mine(status, supporters: 1, owned: false),
|
||||
myPop: 0,
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.widgetWithText(FilledButton, '기여하기'), shown, reason: status.name);
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('타인 캠페인에는 기여하기 버튼이 있다', (tester) async {
|
||||
await pumpWide(tester, CampaignDetailScreen(campaignId: 'c1'));
|
||||
await tester.pumpAndSettle();
|
||||
@@ -529,10 +551,11 @@ void main() {
|
||||
|
||||
/// 내 캠페인 상세 — 상태 · 후원 수를 바꿔 철회 버튼을 본다(B-58).
|
||||
class _Mine extends SampleCampaignRepository {
|
||||
_Mine(this.status, {this.supporters = 0});
|
||||
_Mine(this.status, {this.supporters = 0, this.owned = true});
|
||||
|
||||
final CampaignStatus status;
|
||||
final int supporters;
|
||||
final bool owned;
|
||||
final withdrawn = <String>[];
|
||||
|
||||
@override
|
||||
@@ -545,7 +568,7 @@ class _Mine extends SampleCampaignRepository {
|
||||
createdAt: c.createdAt,
|
||||
status: withdrawn.isEmpty ? status : CampaignStatus.withdrawn,
|
||||
goalPop: c.goalPop, raisedPop: supporters == 0 ? 0 : 10,
|
||||
supporters: supporters, mine: true,
|
||||
supporters: supporters, mine: owned,
|
||||
likes: 0, comments: 0, views: 0, shares: 0,
|
||||
),
|
||||
mediaLabels: base.mediaLabels,
|
||||
|
||||
Reference in New Issue
Block a user