Skip to content

Commit 502cccc

Browse files
fix: Resolve unit test failures preventing release build
1 parent 4a23eec commit 502cccc

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

android/app/src/test/java/com/clhs/score/data/FakeDataTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FakeDataTest {
3434
@Test
3535
fun fakeRepositoryCanServeAppWithoutApiSession() = runTest {
3636
val repository = FakeGradeRepository()
37-
val session = repository.restoreSession()
37+
val session = repository.loginWithCookies("demo-student", emptyMap())
3838

3939
assertNotNull(session)
4040
val structure = repository.loadStructure(session!!)

android/app/src/test/java/com/clhs/score/data/GradeAnalysisTest.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ class GradeAnalysisTest {
272272
currentReport = current,
273273
historyReports = history,
274274
adjustedScores = mapOf(
275-
"國語文" to 68.0,
276-
"英語文" to 82.0,
275+
"國文" to 68.0,
276+
"英文" to 82.0,
277277
"數學" to 84.0,
278278
),
279279
)
@@ -295,7 +295,7 @@ class GradeAnalysisTest {
295295
val simulation = simulateScores(
296296
currentReport = current,
297297
historyReports = history,
298-
adjustedScores = mapOf("國語文" to 68.0),
298+
adjustedScores = mapOf("國文" to 68.0),
299299
)
300300

301301
assertNull(simulation.estimatedClassRank)
@@ -314,8 +314,8 @@ class GradeAnalysisTest {
314314
currentReport = current,
315315
historyReports = history,
316316
adjustedScores = mapOf(
317-
"國語文" to 100.0,
318-
"英語文" to 100.0,
317+
"國文" to 100.0,
318+
"英文" to 100.0,
319319
"數學" to 100.0,
320320
),
321321
)
@@ -336,8 +336,8 @@ class GradeAnalysisTest {
336336
currentReport = current,
337337
historyReports = history,
338338
adjustedScores = mapOf(
339-
"國語文" to 68.0,
340-
"英語文" to 82.0,
339+
"國文" to 68.0,
340+
"英文" to 82.0,
341341
"數學" to 84.0,
342342
),
343343
)
@@ -358,7 +358,7 @@ class GradeAnalysisTest {
358358
val simulation = simulateScores(
359359
currentReport = current,
360360
historyReports = history,
361-
adjustedScores = mapOf("國語文" to 68.0),
361+
adjustedScores = mapOf("國文" to 68.0),
362362
)
363363

364364
assertTrue(simulation.projectedAverage > simulation.adjustedAverage)

0 commit comments

Comments
 (0)