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 = {
|
||||
username: 'testUser',
|
||||
userId: 1,
|
||||
userId: '1',
|
||||
displayName: 'Test User',
|
||||
serverUrl: 'http://localhost:5000',
|
||||
httpHeaders: []
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
|
||||
const preProgramVariables: PreProgramVars = {
|
||||
username: 'testUser',
|
||||
userId: 1,
|
||||
userId: '1',
|
||||
displayName: 'Test User',
|
||||
serverUrl: 'http://localhost:5000',
|
||||
httpHeaders: []
|
||||
|
||||
@@ -71,13 +71,13 @@ describe('code', () => {
|
||||
permissionController = new PermissionController()
|
||||
|
||||
const dbUser = await userController.createUser(user)
|
||||
accessToken = await generateAndSaveToken(dbUser.id)
|
||||
accessToken = await generateAndSaveToken(dbUser.uid)
|
||||
|
||||
await permissionController.createPermission({
|
||||
path: '/SASjsApi/code/execute',
|
||||
type: PermissionType.route,
|
||||
principalType: PrincipalType.user,
|
||||
principalId: dbUser.id,
|
||||
principalId: dbUser.uid,
|
||||
setting: PermissionSettingForRoute.grant
|
||||
})
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('code', () => {
|
||||
})
|
||||
})
|
||||
|
||||
const generateAndSaveToken = async (userId: number) => {
|
||||
const generateAndSaveToken = async (userId: string) => {
|
||||
const accessToken = generateAccessToken({
|
||||
clientId,
|
||||
userId
|
||||
|
||||
Reference in New Issue
Block a user