-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MBL-905: Remove Use of IA tab feature flag (#1932)
- Loading branch information
Showing
5 changed files
with
38 additions
and
97 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/kickstarter/libs/utils/extensions/AiDisclosureExt.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,12 @@ | ||
@file:JvmName("AiDisclosureExt") | ||
package com.kickstarter.libs.utils.extensions | ||
|
||
import com.kickstarter.models.AiDisclosure | ||
|
||
/** | ||
* AiDisclosure model can be empty when all fields shown on the UI are empty, but and ID has been generated. | ||
*/ | ||
fun AiDisclosure.isUIEmptyValues(): Boolean { | ||
return this.generatedByAiConsent.isEmpty() && this.generatedByAiDetails.isEmpty() && this.otherAiDetails.isEmpty() && | ||
!this.fundingForAiConsent && !this.fundingForAiOption && !this.fundingForAiAttribution | ||
} |
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
20 changes: 20 additions & 0 deletions
20
app/src/test/java/com/kickstarter/libs/utils/extensions/AiDisclosureExtTest.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,20 @@ | ||
package com.kickstarter.libs.utils.extensions | ||
|
||
import com.kickstarter.KSRobolectricTestCase | ||
import com.kickstarter.models.AiDisclosure | ||
import io.reactivex.disposables.CompositeDisposable | ||
import org.junit.Test | ||
|
||
class AiDisclosureExtTest : KSRobolectricTestCase() { | ||
|
||
val disposables = CompositeDisposable() | ||
|
||
@Test | ||
fun testEmptyValues() { | ||
val nullVal: AiDisclosure? = null | ||
assertTrue(nullVal.isNull()) | ||
|
||
val emptyVal = AiDisclosure.builder().build() | ||
assertTrue(emptyVal.isUIEmptyValues()) | ||
} | ||
} |
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