Compare commits

...

2 Commits

Author SHA1 Message Date
Glary-Bot
5cd3fc966e test: cover production fallback for nodeLibraryEssentialsEnabled
Add unit tests for the new default-true production fallback and the
explicit-disable path so the rollout semantics are codified.
2026-05-05 04:13:20 +00:00
Glary-Bot
7a902340cb feat: enable Node Library Essentials tab by default
Flip the production fallback for nodeLibraryEssentialsEnabled from false
to true so the Essentials tab ships enabled out-of-the-box. Dev/nightly
already returned true; remote config and the server feature flag still
override (so deployments can disable it explicitly if needed).

Fixes FE-539
2026-05-05 03:59:44 +00:00
2 changed files with 43 additions and 1 deletions

View File

@@ -176,6 +176,48 @@ describe('useFeatureFlags', () => {
})
})
describe('nodeLibraryEssentialsEnabled', () => {
afterEach(() => {
vi.unstubAllEnvs()
})
it('should return true when isNightly is true', () => {
vi.mocked(distributionTypes).isNightly = true
const { flags } = useFeatureFlags()
expect(flags.nodeLibraryEssentialsEnabled).toBe(true)
expect(api.getServerFeature).not.toHaveBeenCalled()
})
it('should default to true in production when no remote config or server flag is set', () => {
vi.mocked(distributionTypes).isNightly = false
vi.stubEnv('DEV', false)
vi.mocked(api.getServerFeature).mockImplementation(
(_path, defaultValue) => defaultValue
)
const { flags } = useFeatureFlags()
expect(flags.nodeLibraryEssentialsEnabled).toBe(true)
expect(api.getServerFeature).toHaveBeenCalledWith(
ServerFeatureFlag.NODE_LIBRARY_ESSENTIALS_ENABLED,
true
)
})
it('should return false in production when the server feature flag explicitly disables it', () => {
vi.mocked(distributionTypes).isNightly = false
vi.stubEnv('DEV', false)
vi.mocked(api.getServerFeature).mockImplementation((path) => {
if (path === ServerFeatureFlag.NODE_LIBRARY_ESSENTIALS_ENABLED)
return false
return undefined
})
const { flags } = useFeatureFlags()
expect(flags.nodeLibraryEssentialsEnabled).toBe(false)
})
})
describe('dev override via localStorage', () => {
afterEach(() => {
localStorage.clear()

View File

@@ -131,7 +131,7 @@ export function useFeatureFlags() {
remoteConfig.value.node_library_essentials_enabled ??
api.getServerFeature(
ServerFeatureFlag.NODE_LIBRARY_ESSENTIALS_ENABLED,
false
true
)
)
},