-
-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adjust after role permissions are transitively deleted
- Loading branch information
Showing
4 changed files
with
52 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,12 @@ import { | |
} from '../../../test/e2e/helpers/test-helper'; | ||
import getLogger from '../../../test/fixtures/no-logger'; | ||
import type { FeatureSearchQueryParameters } from '../../openapi/spec/feature-search-query-parameters'; | ||
import { DEFAULT_PROJECT, type IUnleashStores } from '../../types'; | ||
import { | ||
CREATE_FEATURE_STRATEGY, | ||
DEFAULT_PROJECT, | ||
type IUnleashStores, | ||
UPDATE_FEATURE_ENVIRONMENT, | ||
} from '../../types'; | ||
import { DEFAULT_ENV } from '../../util'; | ||
|
||
let app: IUnleashTest; | ||
|
@@ -29,7 +34,7 @@ beforeAll(async () => { | |
); | ||
stores = db.stores; | ||
|
||
await app.request | ||
const { body } = await app.request | ||
.post(`/auth/demo/login`) | ||
.send({ | ||
email: '[email protected]', | ||
|
@@ -43,12 +48,30 @@ beforeAll(async () => { | |
|
||
await app.linkProjectToEnvironment('default', 'development'); | ||
|
||
await stores.accessStore.addPermissionsToRole( | ||
body.rootRole, | ||
[ | ||
{ name: UPDATE_FEATURE_ENVIRONMENT }, | ||
{ name: CREATE_FEATURE_STRATEGY }, | ||
], | ||
'development', | ||
); | ||
|
||
await stores.environmentStore.create({ | ||
name: 'production', | ||
type: 'production', | ||
}); | ||
|
||
await app.linkProjectToEnvironment('default', 'production'); | ||
|
||
await stores.accessStore.addPermissionsToRole( | ||
body.rootRole, | ||
[ | ||
{ name: UPDATE_FEATURE_ENVIRONMENT }, | ||
{ name: CREATE_FEATURE_STRATEGY }, | ||
], | ||
'production', | ||
); | ||
}); | ||
|
||
afterAll(async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters