fix(editor): sending data as query on DELETE method (#3972)
* 🐛 fix sending data as query on DELETE method * 👕 add type to imports * 💪 enhance test
This commit is contained in:
@@ -45,3 +45,12 @@ const POPULAR_TOP_LEVEL_DOMAINS = ['com', 'org', 'net', 'io', 'edu'];
|
||||
const randomTopLevelDomain = () => chooseRandomly(POPULAR_TOP_LEVEL_DOMAINS);
|
||||
|
||||
export const randomName = () => randomString(4, 8);
|
||||
|
||||
export function randomCredentialPayload() {
|
||||
return {
|
||||
name: randomName(),
|
||||
type: randomName(),
|
||||
nodesAccess: [{ nodeType: randomName() }],
|
||||
data: { accessToken: randomString(6, 16) },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,7 +13,14 @@ import {
|
||||
MAPPING_TABLES_TO_CLEAR,
|
||||
} from './constants';
|
||||
import { DatabaseType, Db, ICredentialsDb } from '../../../src';
|
||||
import { randomApiKey, randomEmail, randomName, randomString, randomValidPassword } from './random';
|
||||
import {
|
||||
randomApiKey,
|
||||
randomCredentialPayload,
|
||||
randomEmail,
|
||||
randomName,
|
||||
randomString,
|
||||
randomValidPassword,
|
||||
} from './random';
|
||||
import { CredentialsEntity } from '../../../src/databases/entities/CredentialsEntity';
|
||||
import { hashPassword } from '../../../src/UserManagement/UserManagementHelper';
|
||||
import { entities } from '../../../src/databases/entities';
|
||||
@@ -287,7 +294,7 @@ function toTableName(sourceName: CollectionName | MappingName) {
|
||||
* Save a credential to the test DB, sharing it with a user.
|
||||
*/
|
||||
export async function saveCredential(
|
||||
credentialPayload: CredentialPayload,
|
||||
credentialPayload: CredentialPayload = randomCredentialPayload(),
|
||||
{ user, role }: { user: User; role: Role },
|
||||
) {
|
||||
const newCredential = new CredentialsEntity();
|
||||
|
||||
Reference in New Issue
Block a user