Fix typo.
This commit is contained in:
parent
e5a9e2dc74
commit
6e722a2998
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.
|
* @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
|
* @param isInLabs whether the user is in labs (to include lab features), default is false
|
||||||
*/
|
*/
|
||||||
fun getAvailableFeatures(
|
fun getAvailableFeatures(
|
||||||
includeFinishFeatures: Boolean = false,
|
includeFinishedFeatures: Boolean = false,
|
||||||
isInLabs: Boolean = false,
|
isInLabs: Boolean = false,
|
||||||
): List<Feature>
|
): List<Feature>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,11 @@ class DefaultFeatureFlagService(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAvailableFeatures(
|
override fun getAvailableFeatures(
|
||||||
includeFinishFeatures: Boolean,
|
includeFinishedFeatures: Boolean,
|
||||||
isInLabs: Boolean,
|
isInLabs: Boolean,
|
||||||
): List<Feature> {
|
): List<Feature> {
|
||||||
return featuresProvider.provide().filter { flag ->
|
return featuresProvider.provide().filter { flag ->
|
||||||
(includeFinishFeatures || !flag.isFinished) &&
|
(includeFinishedFeatures || !flag.isFinished) &&
|
||||||
flag.isInLabs == isInLabs
|
flag.isInLabs == isInLabs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,25 +133,25 @@ class DefaultFeatureFlagServiceTest {
|
||||||
)
|
)
|
||||||
assertThat(
|
assertThat(
|
||||||
featureFlagService.getAvailableFeatures(
|
featureFlagService.getAvailableFeatures(
|
||||||
includeFinishFeatures = false,
|
includeFinishedFeatures = false,
|
||||||
isInLabs = true,
|
isInLabs = true,
|
||||||
)
|
)
|
||||||
).containsExactly(anUnfinishedLabFeature)
|
).containsExactly(anUnfinishedLabFeature)
|
||||||
assertThat(
|
assertThat(
|
||||||
featureFlagService.getAvailableFeatures(
|
featureFlagService.getAvailableFeatures(
|
||||||
includeFinishFeatures = true,
|
includeFinishedFeatures = true,
|
||||||
isInLabs = true,
|
isInLabs = true,
|
||||||
)
|
)
|
||||||
).containsExactly(aFinishedLabFeature, anUnfinishedLabFeature)
|
).containsExactly(aFinishedLabFeature, anUnfinishedLabFeature)
|
||||||
assertThat(
|
assertThat(
|
||||||
featureFlagService.getAvailableFeatures(
|
featureFlagService.getAvailableFeatures(
|
||||||
includeFinishFeatures = false,
|
includeFinishedFeatures = false,
|
||||||
isInLabs = false,
|
isInLabs = false,
|
||||||
)
|
)
|
||||||
).containsExactly(anUnfinishedDevFeature)
|
).containsExactly(anUnfinishedDevFeature)
|
||||||
assertThat(
|
assertThat(
|
||||||
featureFlagService.getAvailableFeatures(
|
featureFlagService.getAvailableFeatures(
|
||||||
includeFinishFeatures = true,
|
includeFinishedFeatures = true,
|
||||||
isInLabs = false,
|
isInLabs = false,
|
||||||
)
|
)
|
||||||
).containsExactly(aFinishedDevFeature, anUnfinishedDevFeature)
|
).containsExactly(aFinishedDevFeature, anUnfinishedDevFeature)
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@ class FakeFeatureFlagService(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAvailableFeatures(
|
override fun getAvailableFeatures(
|
||||||
includeFinishFeatures: Boolean,
|
includeFinishedFeatures: Boolean,
|
||||||
isInLabs: Boolean,
|
isInLabs: Boolean,
|
||||||
): List<Feature> {
|
): List<Feature> {
|
||||||
return getAvailableFeaturesResult(includeFinishFeatures, isInLabs)
|
return getAvailableFeaturesResult(includeFinishedFeatures, isInLabs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue