mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
2e367b3a04
* refactor: simplify useApiGetter cache keys * refactor: simplify basePath helpers * refactor: add UNLEASH_BASE_PATH frontend env var * refactor: make sure AnnouncerElement does not affect the layout * refactor: draw texture image above footer * refactor: extract domain check helpers * refactor: fix a few ts-expect-errors * feat: add trial expiration warning banner * refactor: fix IInstanceStatus interface prefix * refactor: use ConditionallyRender in InstanceStatus * refactor: simplify env helper functions * refactor: use FC in InstanceStatus * refactor: warn about expired trials * refactor: fix eslint warnings * refactor: disable banner outside of localhost * refactor: use new instance state field name
26 lines
889 B
TypeScript
26 lines
889 B
TypeScript
import {
|
|
isLocalhostDomain,
|
|
isVercelBranchDomain,
|
|
isUnleashDomain,
|
|
} from 'utils/env';
|
|
|
|
test('isLocalhostDomain', () => {
|
|
expect(isLocalhostDomain()).toEqual(true);
|
|
expect(isLocalhostDomain('unleash-hosted.com')).toEqual(false);
|
|
});
|
|
|
|
test('isUnleashDomain', () => {
|
|
expect(isUnleashDomain()).toEqual(false);
|
|
expect(isUnleashDomain('vercel.app')).toEqual(false);
|
|
expect(isUnleashDomain('app.getunleash.io')).toEqual(true);
|
|
expect(isUnleashDomain('app.unleash-hosted.com')).toEqual(true);
|
|
});
|
|
|
|
test('isVercelBranchDomain', () => {
|
|
expect(isVercelBranchDomain()).toEqual(false);
|
|
expect(isVercelBranchDomain('getunleash.io')).toEqual(false);
|
|
expect(isVercelBranchDomain('unleash-hosted.com')).toEqual(false);
|
|
expect(isVercelBranchDomain('vercel.app')).toEqual(false);
|
|
expect(isVercelBranchDomain('branch.vercel.app')).toEqual(true);
|
|
});
|