2026-05-19 15:43:16 +08:00
|
|
|
import {
|
|
|
|
|
appVariant,
|
|
|
|
|
config,
|
|
|
|
|
shouldShowAboutBackendUrl,
|
|
|
|
|
type AppVariant,
|
|
|
|
|
} from '@/core/config';
|
|
|
|
|
|
|
|
|
|
describe('shouldShowAboutBackendUrl', () => {
|
|
|
|
|
it('shows backend URL for development and staging', () => {
|
|
|
|
|
expect(shouldShowAboutBackendUrl('development')).toBe(true);
|
|
|
|
|
expect(shouldShowAboutBackendUrl('staging')).toBe(true);
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-20 10:27:40 +08:00
|
|
|
it('hides backend URL for production when not in __DEV__', () => {
|
|
|
|
|
if (__DEV__) {
|
|
|
|
|
expect(shouldShowAboutBackendUrl('production')).toBe(true);
|
|
|
|
|
} else {
|
|
|
|
|
expect(shouldShowAboutBackendUrl('production')).toBe(false);
|
|
|
|
|
}
|
2026-05-19 15:43:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('matches config.showAboutBackendUrl for current build', () => {
|
|
|
|
|
expect(config.showAboutBackendUrl).toBe(
|
|
|
|
|
shouldShowAboutBackendUrl(appVariant as AppVariant),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|