mirror of
https://github.com/sasjs/server.git
synced 2026-07-23 21:25:29 +00:00
fix: update test fixtures for userId: string after ID->UID merge
Execution.spec.ts, processProgram.spec.ts and code.spec.ts didn't exist when issue-361 (ID -> UID) branched, so they were written against the old userId: number shape. Update them to match the merged-in string-based uid now that main has been merged in.
This commit is contained in:
@@ -8,7 +8,7 @@ import { RunTimeType } from '../../../utils'
|
|||||||
|
|
||||||
const preProgramVariables: PreProgramVars = {
|
const preProgramVariables: PreProgramVars = {
|
||||||
username: 'testUser',
|
username: 'testUser',
|
||||||
userId: 1,
|
userId: '1',
|
||||||
displayName: 'Test User',
|
displayName: 'Test User',
|
||||||
serverUrl: 'http://localhost:5000',
|
serverUrl: 'http://localhost:5000',
|
||||||
httpHeaders: []
|
httpHeaders: []
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
|
|
||||||
const preProgramVariables: PreProgramVars = {
|
const preProgramVariables: PreProgramVars = {
|
||||||
username: 'testUser',
|
username: 'testUser',
|
||||||
userId: 1,
|
userId: '1',
|
||||||
displayName: 'Test User',
|
displayName: 'Test User',
|
||||||
serverUrl: 'http://localhost:5000',
|
serverUrl: 'http://localhost:5000',
|
||||||
httpHeaders: []
|
httpHeaders: []
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ describe('code', () => {
|
|||||||
permissionController = new PermissionController()
|
permissionController = new PermissionController()
|
||||||
|
|
||||||
const dbUser = await userController.createUser(user)
|
const dbUser = await userController.createUser(user)
|
||||||
accessToken = await generateAndSaveToken(dbUser.id)
|
accessToken = await generateAndSaveToken(dbUser.uid)
|
||||||
|
|
||||||
await permissionController.createPermission({
|
await permissionController.createPermission({
|
||||||
path: '/SASjsApi/code/execute',
|
path: '/SASjsApi/code/execute',
|
||||||
type: PermissionType.route,
|
type: PermissionType.route,
|
||||||
principalType: PrincipalType.user,
|
principalType: PrincipalType.user,
|
||||||
principalId: dbUser.id,
|
principalId: dbUser.uid,
|
||||||
setting: PermissionSettingForRoute.grant
|
setting: PermissionSettingForRoute.grant
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ describe('code', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const generateAndSaveToken = async (userId: number) => {
|
const generateAndSaveToken = async (userId: string) => {
|
||||||
const accessToken = generateAccessToken({
|
const accessToken = generateAccessToken({
|
||||||
clientId,
|
clientId,
|
||||||
userId
|
userId
|
||||||
|
|||||||
Reference in New Issue
Block a user