mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 14:25:46 +01:00
test: ✅ wizardEnv API
This commit is contained in:
parent
d753df49a0
commit
da60d50dcb
2 changed files with 14 additions and 18 deletions
|
|
@ -3,14 +3,13 @@ import React from 'react';
|
|||
import { useState } from 'react';
|
||||
import classes from './QuickCommands.module.css';
|
||||
import { IconSettingsAutomation, IconCopy } from '@tabler/icons-react';
|
||||
import lanCommandOption from '../../../helpers/functions/lanCommandOption';
|
||||
import { Optional } from '~/types';
|
||||
import lanCommandOption from '~/helpers/functions/lanCommandOption';
|
||||
import { WizardEnvType } from '~/types/domain/config.types';
|
||||
|
||||
type QuickCommandsProps = {
|
||||
repositoryName: string;
|
||||
wizardEnv: Optional<WizardEnvType>;
|
||||
lanCommand: boolean;
|
||||
wizardEnv?: WizardEnvType;
|
||||
lanCommand?: boolean;
|
||||
};
|
||||
|
||||
export default function QuickCommands(props: QuickCommandsProps) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { createMocks } from 'node-mocks-http';
|
||||
import handler from '~/pages/api/account/getWizardEnv';
|
||||
import { getServerSession } from 'next-auth/next';
|
||||
import { WizardEnvEnum } from '~/types/domain/config.types';
|
||||
|
||||
jest.mock('next-auth/next');
|
||||
|
||||
|
|
@ -33,19 +32,17 @@ describe('Get Wizard Env API', () => {
|
|||
|
||||
expect(res._getStatusCode()).toBe(200);
|
||||
expect(res._getJSONData()).toEqual({
|
||||
wizardEnv: {
|
||||
UNIX_USER: 'borgwarehouse',
|
||||
FQDN: 'localhost',
|
||||
SSH_SERVER_PORT: '22',
|
||||
FQDN_LAN: '',
|
||||
SSH_SERVER_PORT_LAN: '',
|
||||
SSH_SERVER_FINGERPRINT_RSA: '',
|
||||
SSH_SERVER_FINGERPRINT_ED25519: '',
|
||||
SSH_SERVER_FINGERPRINT_ECDSA: '',
|
||||
HIDE_SSH_PORT: 'false',
|
||||
DISABLE_INTEGRATIONS: 'false',
|
||||
DISABLE_DELETE_REPO: 'false',
|
||||
},
|
||||
UNIX_USER: 'borgwarehouse',
|
||||
FQDN: 'localhost',
|
||||
SSH_SERVER_PORT: '22',
|
||||
FQDN_LAN: '',
|
||||
SSH_SERVER_PORT_LAN: '',
|
||||
SSH_SERVER_FINGERPRINT_RSA: '',
|
||||
SSH_SERVER_FINGERPRINT_ED25519: '',
|
||||
SSH_SERVER_FINGERPRINT_ECDSA: '',
|
||||
HIDE_SSH_PORT: 'false',
|
||||
DISABLE_INTEGRATIONS: 'false',
|
||||
DISABLE_DELETE_REPO: 'false',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue