Skip to content

Commit 1d2657d

Browse files
organize code
1 parent 564fb29 commit 1d2657d

File tree

7 files changed

+3
-41
lines changed

7 files changed

+3
-41
lines changed

Stanford360/Activity/Model/ActivityManager.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ class ActivityManager: Module, EnvironmentAccessible {
8585
minutes * 100
8686
}
8787

88-
func triggerMotivation() -> String {
89-
if getTodayTotalMinutes() >= 60 {
90-
return "🎉 Amazing! You've reached your daily goal of 60 minutes!"
91-
} else if getTodayTotalMinutes() > 0 {
92-
let remainingMinutes = 60 - getTodayTotalMinutes()
93-
return "Keep going! Only \(remainingMinutes) more minutes to reach today's goal! 🚀"
94-
} else {
95-
return "Start your activity today and move towards your goal! 💪"
96-
}
97-
}
98-
9988
func saveToStorage() {
10089
do {
10190
let data = try JSONEncoder().encode(activities)

Stanford360/Protein/View/ProteinAddView.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ struct ProteinAddView: View {
4444
.offset(y: -250)
4545
}
4646
}
47-
48-
/*
49-
private var motivationText: some View {
50-
Text(proteinManager.triggerMotivation())
51-
.font(.headline)
52-
.foregroundColor(.blue)
53-
.padding()
54-
.background(
55-
RoundedRectangle(cornerRadius: 15)
56-
.fill(Color.blue.opacity(0.1))
57-
)
58-
}
59-
*/
6047
}
6148

6249
#Preview {

Stanford360/Resources/Localizable.xcstrings

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,12 +832,6 @@
832832
}
833833
}
834834
}
835-
},
836-
"What did you do?" : {
837-
838-
},
839-
"When did you do it?" : {
840-
841835
},
842836
"You need %@ %@ more to reach your goal!" : {
843837
"localizations" : {

Stanford360Tests/HydrationTests/HydrationManagerTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ final class HydrationManagerTests: XCTestCase {
7878
XCTAssertEqual(hydrationManager.streak, 2, "Streak should be 2 as the third day is below 60 oz.")
7979
}
8080

81+
// Test Streak if skip one day
8182
func testStreakResetsOnSkippedDays() {
8283
guard let hydrationManager else {
8384
XCTFail("HydrationManager not initialized")
@@ -94,7 +95,7 @@ final class HydrationManagerTests: XCTestCase {
9495

9596
hydrationManager.hydration = [
9697
HydrationLog(hydrationOunces: 60, timestamp: today),
97-
HydrationLog(hydrationOunces: 60, timestamp: twoDaysAgo) // Skipped yesterday
98+
HydrationLog(hydrationOunces: 60, timestamp: twoDaysAgo)
9899
]
99100

100101
XCTAssertEqual(hydrationManager.streak, 1, "Streak should reset due to a skipped day.")

Stanford360Tests/MilestoneTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import XCTest
99

1010
final class MilestoneManagerTests: XCTestCase {
11-
var milestoneManager: MilestoneManager? // ✅ Correct Optional Syntax
11+
var milestoneManager: MilestoneManager?
1212

1313
override func setUp() {
1414
super.setUp()

Stanford360Tests/ProteinTest/ProteinManagerTest.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,4 @@ final class ProteinManagerTests: XCTestCase {
5757
let manager = ProteinManager(meals: [meal1, meal2, meal3])
5858
XCTAssertEqual(manager.streak, 2, "Streak should be 2 days")
5959
}
60-
61-
// func testTriggerMotivation() {
62-
// let meal1 = Meal(name: "Omelette", proteinGrams: 40, imageURL: "", timestamp: Date(), id: "11")
63-
// let manager = ProteinManager(meals: [meal1])
64-
// let motivationMessage = manager.triggerMotivation()
65-
//
66-
// XCTAssertTrue(motivationMessage.contains("Keep going"), "Message should encourage the user to reach 60g")
67-
// }
6860
}

Stanford360UITests/HydrationUITests/HydrationHistoryTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ final class HydrationHistoryViewTests: XCTestCase {
4444
app.staticTexts["20 oz"].tap()
4545
logButton.tap()
4646

47-
// let historyButton = app.buttons["History"]
4847
historyButton.tap()
4948

5049
let hydrationLogEntry = app.staticTexts["hydrationLogEntry"]

0 commit comments

Comments
 (0)