Skip to content

Commit

Permalink
Merge pull request #171 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
Added new photo id attestation to scoped issuance list
  • Loading branch information
stzouvaras authored Aug 12, 2024
2 parents 2706c2a + fb72bc6 commit bc58b18
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ object TestsData {
const val mockedDocUiNamePid = "National ID"
const val mockedDocUiNameMdl = "Driving License"
const val mockedDocUiNameAge = "Age Verification"
const val mockedDocUiNamePhotoId = "Photo ID"
const val mockedDocUiNameSampleData = "Load Sample Documents"
const val mockedNoUserFistNameFound = ""
const val mockedNoUserBase64PortraitFound = ""
Expand Down Expand Up @@ -440,6 +441,13 @@ object TestsData {
available = true
)

val mockedPhotoIdOptionItemUi = DocumentOptionItemUi(
text = mockedDocUiNamePhotoId,
icon = AppIcons.Id,
type = DocumentIdentifier.PHOTOID,
available = true
)

val mockedSampleDataOptionItemUi = DocumentOptionItemUi(
text = mockedDocUiNameSampleData,
icon = AppIcons.Id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ class AddDocumentInteractorImpl(
icon = AppIcons.Id,
type = DocumentIdentifier.AGE,
available = canCreateExtraDocument(flowType)
),
DocumentOptionItemUi(
text = DocumentIdentifier.PHOTOID.toUiName(resourceProvider),
icon = AppIcons.Id,
type = DocumentIdentifier.PHOTOID,
available = canCreateExtraDocument(flowType)
)
)
if (flowType == IssuanceFlowUiConfig.NO_DOCUMENT) {
Expand All @@ -115,7 +121,6 @@ class AddDocumentInteractorImpl(
)
)
}

emit(
AddDocumentInteractorPartialState.Success(
options = options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import eu.europa.ec.commonfeature.config.IssuanceFlowUiConfig
import eu.europa.ec.commonfeature.interactor.DeviceAuthenticationInteractor
import eu.europa.ec.commonfeature.util.TestsData.mockedAgeOptionItemUi
import eu.europa.ec.commonfeature.util.TestsData.mockedMdlOptionItemUi
import eu.europa.ec.commonfeature.util.TestsData.mockedPhotoIdOptionItemUi
import eu.europa.ec.commonfeature.util.TestsData.mockedPidId
import eu.europa.ec.commonfeature.util.TestsData.mockedPidOptionItemUi
import eu.europa.ec.commonfeature.util.TestsData.mockedSampleDataOptionItemUi
Expand Down Expand Up @@ -137,6 +138,9 @@ class TestAddDocumentInteractor {
mockedAgeOptionItemUi.copy(
available = false
),
mockedPhotoIdOptionItemUi.copy(
available = false
),
mockedSampleDataOptionItemUi
)
),
Expand Down Expand Up @@ -170,7 +174,8 @@ class TestAddDocumentInteractor {
options = listOf(
mockedPidOptionItemUi,
mockedMdlOptionItemUi,
mockedAgeOptionItemUi
mockedAgeOptionItemUi,
mockedPhotoIdOptionItemUi
)
),
awaitItem()
Expand Down
7 changes: 7 additions & 0 deletions test-feature/src/main/java/eu/europa/ec/testfeature/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.mockito.kotlin.whenever
private const val mockedDocUiNamePid = "National ID"
private const val mockedDocUiNameMdl = "Driving License"
private const val mockedDocUiNameAgeVerification = "Age Verification"
private const val mockedDocUiNamePhotoId = "Photo ID"
private const val mockedDocUiNameSampleData = "Load Sample Documents"

@VisibleForTesting(otherwise = VisibleForTesting.NONE)
Expand All @@ -45,6 +46,12 @@ object MockResourceProviderForStringCalls {

whenever(resourceProvider.getString(R.string.age_verification))
.thenReturn(mockedDocUiNameAgeVerification)

whenever(resourceProvider.getString(R.string.age_verification))
.thenReturn(mockedDocUiNameAgeVerification)

whenever(resourceProvider.getString(R.string.photo_id))
.thenReturn(mockedDocUiNamePhotoId)
}

/**
Expand Down

0 comments on commit bc58b18

Please sign in to comment.