1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.settings.remoteauth.finish
18 
19 import android.os.Bundle
20 import androidx.fragment.app.testing.launchFragmentInContainer
21 import androidx.test.espresso.Espresso.onView
22 import androidx.test.espresso.assertion.ViewAssertions.matches
23 import androidx.test.espresso.matcher.ViewMatchers.*
24 import com.android.settings.R
25 import org.junit.Before
26 import org.junit.Test
27 import org.junit.runner.RunWith
28 import org.robolectric.RobolectricTestRunner
29 
30 @RunWith(RobolectricTestRunner::class)
31 class RemoteAuthEnrollFinishTest {
32 
33     @Before
setupnull34     fun setup() {
35         launchFragmentInContainer<RemoteAuthEnrollFinish>(Bundle(), R.style.SudThemeGlif)
36     }
37 
38     @Test
testRemoteAuthenticatorEnrollFinish_headerVisiblenull39     fun testRemoteAuthenticatorEnrollFinish_headerVisible() {
40         onView(withText(R.string.security_settings_remoteauth_enroll_finish_title)).check(
41             matches(
42                 withEffectiveVisibility(Visibility.VISIBLE)
43             )
44         )
45     }
46 
47     @Test
testRemoteAuthenticatorEnrollFinish_descriptionVisiblenull48     fun testRemoteAuthenticatorEnrollFinish_descriptionVisible() {
49         onView(withText(R.string.security_settings_remoteauth_enroll_finish_description)).check(
50             matches(
51                 withEffectiveVisibility(Visibility.VISIBLE)
52             )
53         )
54     }
55 }
56