mirror of
https://github.com/hexastack/hexabot
synced 2024-11-24 04:53:41 +00:00
fix: fix old unit tests
This commit is contained in:
parent
92003c471e
commit
982200cc3a
@ -100,6 +100,7 @@ describe('ContextVarController', () => {
|
||||
const contextVarCreateDto: ContextVarCreateDto = {
|
||||
label: 'contextVarLabel2',
|
||||
name: 'test_add',
|
||||
permanent: false,
|
||||
};
|
||||
const result = await contextVarController.create(contextVarCreateDto);
|
||||
|
||||
|
@ -20,6 +20,9 @@ export class ContextVarCreateDto {
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@ApiProperty({ description: 'Is context var permanent', type: Boolean })
|
||||
permanent?: boolean;
|
||||
}
|
||||
|
||||
export class ContextVarUpdateDto extends PartialType(ContextVarCreateDto) {}
|
||||
|
@ -59,15 +59,18 @@ import { CategoryRepository } from './../repositories/category.repository';
|
||||
import { BlockService } from './block.service';
|
||||
import { BotService } from './bot.service';
|
||||
import { CategoryService } from './category.service';
|
||||
import { ContextVarService } from './context-var.service';
|
||||
import { ConversationService } from './conversation.service';
|
||||
import { MessageService } from './message.service';
|
||||
import { SubscriberService } from './subscriber.service';
|
||||
import { BlockRepository } from '../repositories/block.repository';
|
||||
import { ContextVarRepository } from '../repositories/context-var.repository';
|
||||
import { ConversationRepository } from '../repositories/conversation.repository';
|
||||
import { MessageRepository } from '../repositories/message.repository';
|
||||
import { SubscriberRepository } from '../repositories/subscriber.repository';
|
||||
import { BlockFull, BlockModel } from '../schemas/block.schema';
|
||||
import { CategoryModel } from '../schemas/category.schema';
|
||||
import { ContextVarModel } from '../schemas/context-var.schema';
|
||||
import {
|
||||
Conversation,
|
||||
ConversationFull,
|
||||
@ -107,6 +110,7 @@ describe('BlockService', () => {
|
||||
NlpEntityModel,
|
||||
NlpSampleEntityModel,
|
||||
NlpSampleModel,
|
||||
ContextVarModel,
|
||||
]),
|
||||
],
|
||||
providers: [
|
||||
@ -143,6 +147,8 @@ describe('BlockService', () => {
|
||||
NlpSampleEntityService,
|
||||
NlpSampleService,
|
||||
NlpService,
|
||||
ContextVarService,
|
||||
ContextVarRepository,
|
||||
{
|
||||
provide: PluginService,
|
||||
useValue: {},
|
||||
|
2
api/src/utils/test/fixtures/contextvar.ts
vendored
2
api/src/utils/test/fixtures/contextvar.ts
vendored
@ -18,10 +18,12 @@ const contextVars: ContextVarCreateDto[] = [
|
||||
{
|
||||
label: 'test context var 1',
|
||||
name: 'test1',
|
||||
permanent: false,
|
||||
},
|
||||
{
|
||||
label: 'test context var 2',
|
||||
name: 'test2',
|
||||
permanent: false,
|
||||
},
|
||||
];
|
||||
|
||||
|
3
api/src/utils/test/fixtures/subscriber.ts
vendored
3
api/src/utils/test/fixtures/subscriber.ts
vendored
@ -91,6 +91,9 @@ export const subscriberDefaultValues: TFixturesDefaultValues<Subscriber> = {
|
||||
lastvisit: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
||||
retainedFrom: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
||||
avatar: null,
|
||||
/*context: {
|
||||
vars: {},
|
||||
}*/ // TODO: add unit tests taking into account the context field
|
||||
};
|
||||
|
||||
export const subscriberFixtures = getFixturesWithDefaultValues<Subscriber>({
|
||||
|
Loading…
Reference in New Issue
Block a user