mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
fix: make test run successfull again
This commit is contained in:
parent
150b74cca8
commit
41b7c336e4
@ -3,6 +3,7 @@ import getLogger from '../../fixtures/no-logger';
|
||||
import { ApiTokenService } from '../../../lib/services/api-token-service';
|
||||
import { createTestConfig } from '../../config/test-config';
|
||||
import { ApiTokenType, IApiToken } from '../../../lib/types/models/api-token';
|
||||
import { DEFAULT_ENV } from '../../../lib/util/constants';
|
||||
|
||||
let db;
|
||||
let stores;
|
||||
@ -43,7 +44,7 @@ test('should create client token', async () => {
|
||||
username: 'default-client',
|
||||
type: ApiTokenType.CLIENT,
|
||||
project: '*',
|
||||
environment: '*',
|
||||
environment: DEFAULT_ENV,
|
||||
});
|
||||
const allTokens = await apiTokenService.getAllTokens();
|
||||
|
||||
@ -73,7 +74,7 @@ test('should set expiry of token', async () => {
|
||||
type: ApiTokenType.CLIENT,
|
||||
expiresAt: time,
|
||||
project: '*',
|
||||
environment: '*',
|
||||
environment: DEFAULT_ENV,
|
||||
});
|
||||
|
||||
const [token] = await apiTokenService.getAllTokens();
|
||||
@ -90,7 +91,7 @@ test('should update expiry of token', async () => {
|
||||
type: ApiTokenType.CLIENT,
|
||||
expiresAt: time,
|
||||
project: '*',
|
||||
environment: '*',
|
||||
environment: DEFAULT_ENV,
|
||||
});
|
||||
|
||||
await apiTokenService.updateExpiry(token.secret, newTime);
|
||||
@ -109,7 +110,7 @@ test('should only return valid tokens', async () => {
|
||||
type: ApiTokenType.CLIENT,
|
||||
expiresAt: new Date('2021-01-01'),
|
||||
project: '*',
|
||||
environment: '*',
|
||||
environment: DEFAULT_ENV,
|
||||
});
|
||||
|
||||
const activeToken = await apiTokenService.createApiToken({
|
||||
@ -117,7 +118,7 @@ test('should only return valid tokens', async () => {
|
||||
type: ApiTokenType.CLIENT,
|
||||
expiresAt: tomorrow,
|
||||
project: '*',
|
||||
environment: '*',
|
||||
environment: DEFAULT_ENV,
|
||||
});
|
||||
|
||||
const tokens = await apiTokenService.getAllActiveTokens();
|
||||
|
@ -1,4 +1,4 @@
|
||||
exported412-enterprise.json{
|
||||
{
|
||||
"version": 2,
|
||||
"features": [
|
||||
{
|
||||
@ -145,7 +145,7 @@ exported412-enterprise.json{
|
||||
"id": "2ea91298-4565-4db2-8a23-50757001a076",
|
||||
"featureName": "this-is-fun",
|
||||
"projectName": "default",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "gradualRolloutRandom",
|
||||
"parameters": {
|
||||
"percentage": "100"
|
||||
@ -157,7 +157,7 @@ exported412-enterprise.json{
|
||||
"id": "edaffaee-cf6e-473f-b137-ae15fb88ff53",
|
||||
"featureName": "version.three.seventeen",
|
||||
"projectName": "default",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "default",
|
||||
"parameters": {},
|
||||
"constraints": [],
|
||||
@ -167,7 +167,7 @@ exported412-enterprise.json{
|
||||
"id": "e6eaede4-027a-41a9-8e80-0e0fc0a5d7af",
|
||||
"featureName": "in-another-project",
|
||||
"projectName": "someother",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "gradualRolloutRandom",
|
||||
"parameters": {
|
||||
"percentage": "29"
|
||||
@ -194,7 +194,7 @@ exported412-enterprise.json{
|
||||
"id": "da60e934-246c-4b3e-b314-f2fd1828dd51",
|
||||
"featureName": "with-constraints",
|
||||
"projectName": "default",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "default",
|
||||
"parameters": {},
|
||||
"constraints": [
|
||||
@ -212,7 +212,7 @@ exported412-enterprise.json{
|
||||
"id": "162058f5-3600-4299-97df-d543a0301bdd",
|
||||
"featureName": "another-toggle",
|
||||
"projectName": "someother",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "userWithId",
|
||||
"parameters": {
|
||||
"userIds": "12541,123"
|
||||
@ -224,7 +224,7 @@ exported412-enterprise.json{
|
||||
"id": "5630e0fb-ebc1-4313-b6df-06b0a563c7b4",
|
||||
"featureName": "toggle-created-in-4-1",
|
||||
"projectName": "default",
|
||||
"environment": "default",
|
||||
"environment": ":global:",
|
||||
"strategyName": "applicationHostname",
|
||||
"parameters": {
|
||||
"hostNames": "vg.no"
|
||||
@ -235,7 +235,7 @@ exported412-enterprise.json{
|
||||
],
|
||||
"environments": [
|
||||
{
|
||||
"name": "default",
|
||||
"name": ":global:",
|
||||
"displayName": "Across all environments"
|
||||
}
|
||||
],
|
||||
@ -243,32 +243,32 @@ exported412-enterprise.json{
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "this-is-fun",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "version.three.seventeen",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "in-another-project",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "with-constraints",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "another-toggle",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
},
|
||||
{
|
||||
"enabled": true,
|
||||
"featureName": "toggle-created-in-4-1",
|
||||
"environment": "default"
|
||||
"environment": ":global:"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user