forked from iSoron/uhabits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rechee
committed
Jan 9, 2020
1 parent
f5be9d3
commit fa7bc27
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...oid/src/androidTest/java/org/isoron/uhabits/activities/habits/show/views/NotesCardTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.isoron.uhabits.activities.habits.show.views | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.filters.MediumTest | ||
import org.isoron.uhabits.BaseViewTest | ||
import org.isoron.uhabits.R | ||
import org.isoron.uhabits.core.models.Habit | ||
import org.isoron.uhabits.core.models.Reminder | ||
import org.isoron.uhabits.core.models.WeekdayList | ||
import org.junit.Before | ||
import org.junit.Ignore | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
@MediumTest | ||
class NotesCardTest: BaseViewTest() { | ||
|
||
val PATH = "habits/show/NotesCard/" | ||
|
||
private lateinit var view: SubtitleCard | ||
|
||
private lateinit var habit: Habit | ||
|
||
@Before | ||
override fun setUp() { | ||
super.setUp() | ||
habit = fixtures.createLongHabit() | ||
habit.setReminder(Reminder(8, 30, WeekdayList.EVERY_DAY)) | ||
view = LayoutInflater | ||
.from(targetContext) | ||
.inflate(R.layout.show_habit, null) | ||
.findViewById<View>(R.id.subtitleCard) as SubtitleCard | ||
view.apply { | ||
habit = habit | ||
refreshData() | ||
measureView(this, 800f, 200f) | ||
} | ||
} | ||
|
||
@Ignore("how do I generate these shots?") | ||
@Test | ||
@Throws(Exception::class) | ||
fun testRender() { | ||
assertRenders(view, SubtitleCardTest.PATH + "render.png") | ||
} | ||
} |