chore: fix feature roles

This commit is contained in:
Aman Harwara
2023-05-22 21:09:44 +05:30
parent 56b4c1aa80
commit 11b4377b76
4 changed files with 16 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ type RoleFields = {
/** Statically populated. Non-influencing; used as a reference by other static consumers (such as email service) */
availableInSubscriptions: SubscriptionName[]
availableInRoles?: string[]
availableInRoles: string[]
}
export type BaseFeatureDescription = RoleFields & {

View File

@@ -2,11 +2,11 @@ import { SubscriptionName } from '@standardnotes/common'
import { GetFeatures, GetFeaturesForSubscription } from './Features'
describe('features', () => {
it('all features should have either availableInSubscriptions or availableInRoles populated', () => {
it('all features should have availableInRoles populated', () => {
const features = GetFeatures()
for (const feature of features) {
expect(feature.availableInSubscriptions.length > 0 || feature.availableInRoles !== undefined && feature.availableInRoles.length > 0).toBeTruthy()
expect(feature.availableInRoles !== undefined && feature.availableInRoles.length > 0).toBeTruthy()
}
})
it('gets features for plus plan', () => {