Fix typo.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user