Fix typo.
This commit is contained in:
parent
455ddb5b43
commit
a38df694fd
4 changed files with 10 additions and 10 deletions
|
|
@ -36,11 +36,11 @@ interface FeatureFlagService {
|
|||
|
||||
/**
|
||||
* @return the list of available features that can be toggled.
|
||||
* @param includeFinishFeatures whether to include finished features, default is false
|
||||
* @param includeFinishedFeatures whether to include finished features, default is false
|
||||
* @param isInLabs whether the user is in labs (to include lab features), default is false
|
||||
*/
|
||||
fun getAvailableFeatures(
|
||||
includeFinishFeatures: Boolean = false,
|
||||
includeFinishedFeatures: Boolean = false,
|
||||
isInLabs: Boolean = false,
|
||||
): List<Feature>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ class DefaultFeatureFlagService(
|
|||
}
|
||||
|
||||
override fun getAvailableFeatures(
|
||||
includeFinishFeatures: Boolean,
|
||||
includeFinishedFeatures: Boolean,
|
||||
isInLabs: Boolean,
|
||||
): List<Feature> {
|
||||
return featuresProvider.provide().filter { flag ->
|
||||
(includeFinishFeatures || !flag.isFinished) &&
|
||||
(includeFinishedFeatures || !flag.isFinished) &&
|
||||
flag.isInLabs == isInLabs
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,25 +133,25 @@ class DefaultFeatureFlagServiceTest {
|
|||
)
|
||||
assertThat(
|
||||
featureFlagService.getAvailableFeatures(
|
||||
includeFinishFeatures = false,
|
||||
includeFinishedFeatures = false,
|
||||
isInLabs = true,
|
||||
)
|
||||
).containsExactly(anUnfinishedLabFeature)
|
||||
assertThat(
|
||||
featureFlagService.getAvailableFeatures(
|
||||
includeFinishFeatures = true,
|
||||
includeFinishedFeatures = true,
|
||||
isInLabs = true,
|
||||
)
|
||||
).containsExactly(aFinishedLabFeature, anUnfinishedLabFeature)
|
||||
assertThat(
|
||||
featureFlagService.getAvailableFeatures(
|
||||
includeFinishFeatures = false,
|
||||
includeFinishedFeatures = false,
|
||||
isInLabs = false,
|
||||
)
|
||||
).containsExactly(anUnfinishedDevFeature)
|
||||
assertThat(
|
||||
featureFlagService.getAvailableFeatures(
|
||||
includeFinishFeatures = true,
|
||||
includeFinishedFeatures = true,
|
||||
isInLabs = false,
|
||||
)
|
||||
).containsExactly(aFinishedDevFeature, anUnfinishedDevFeature)
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ class FakeFeatureFlagService(
|
|||
}
|
||||
|
||||
override fun getAvailableFeatures(
|
||||
includeFinishFeatures: Boolean,
|
||||
includeFinishedFeatures: Boolean,
|
||||
isInLabs: Boolean,
|
||||
): List<Feature> {
|
||||
return getAvailableFeaturesResult(includeFinishFeatures, isInLabs)
|
||||
return getAvailableFeaturesResult(includeFinishedFeatures, isInLabs)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue