mirror of
https://github.com/hexastack/hexabot
synced 2025-04-25 00:39:43 +00:00
fix: update fixture default values variable naming
This commit is contained in:
parent
ae2a13ec76
commit
efc3ebb9b6
6
api/src/utils/test/fixtures/category.ts
vendored
6
api/src/utils/test/fixtures/category.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -19,7 +19,7 @@ export type TCategoryFixtures = FixturesTypeBuilder<
|
|||||||
CategoryCreateDto
|
CategoryCreateDto
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TCategoryFixtures['defaultValues'] = {
|
export const categoryDefaultValues: TCategoryFixtures['defaultValues'] = {
|
||||||
builtin: false,
|
builtin: false,
|
||||||
zoom: 100,
|
zoom: 100,
|
||||||
offset: [0, 0],
|
offset: [0, 0],
|
||||||
@ -38,7 +38,7 @@ export const categoryFixtures = getFixturesWithDefaultValues<
|
|||||||
TCategoryFixtures['values']
|
TCategoryFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: categories,
|
fixtures: categories,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: categoryDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installCategoryFixtures = async () => {
|
export const installCategoryFixtures = async () => {
|
||||||
|
6
api/src/utils/test/fixtures/content.ts
vendored
6
api/src/utils/test/fixtures/content.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -19,7 +19,7 @@ import { installContentTypeFixtures } from './contenttype';
|
|||||||
|
|
||||||
type TContentFixtures = FixturesTypeBuilder<Content, ContentCreateDto>;
|
type TContentFixtures = FixturesTypeBuilder<Content, ContentCreateDto>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TContentFixtures['defaultValues'] = {
|
export const contentDefaultValues: TContentFixtures['defaultValues'] = {
|
||||||
status: true,
|
status: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ export const contentFixtures = getFixturesWithDefaultValues<
|
|||||||
TContentFixtures['values']
|
TContentFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: contents,
|
fixtures: contents,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: contentDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installContentFixtures = async () => {
|
export const installContentFixtures = async () => {
|
||||||
|
6
api/src/utils/test/fixtures/contenttype.ts
vendored
6
api/src/utils/test/fixtures/contenttype.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -22,7 +22,7 @@ type TContentTypeFixtures = FixturesTypeBuilder<
|
|||||||
ContentTypeCreateDto
|
ContentTypeCreateDto
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TContentTypeFixtures['defaultValues'] = {
|
export const contentTypeDefaultValues: TContentTypeFixtures['defaultValues'] = {
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'title',
|
name: 'title',
|
||||||
@ -124,7 +124,7 @@ export const contentTypeFixtures = getFixturesWithDefaultValues<
|
|||||||
TContentTypeFixtures['values']
|
TContentTypeFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: contentTypes,
|
fixtures: contentTypes,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: contentTypeDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installContentTypeFixtures = async () => {
|
export const installContentTypeFixtures = async () => {
|
||||||
|
6
api/src/utils/test/fixtures/contextvar.ts
vendored
6
api/src/utils/test/fixtures/contextvar.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -16,7 +16,7 @@ import { FixturesTypeBuilder } from '../types';
|
|||||||
|
|
||||||
type TContentVarFixtures = FixturesTypeBuilder<ContextVar, ContextVarCreateDto>;
|
type TContentVarFixtures = FixturesTypeBuilder<ContextVar, ContextVarCreateDto>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TContentVarFixtures['defaultValues'] = {
|
export const contentVarDefaultValues: TContentVarFixtures['defaultValues'] = {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export const contextVarFixtures = getFixturesWithDefaultValues<
|
|||||||
TContentVarFixtures['values']
|
TContentVarFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: contextVars,
|
fixtures: contextVars,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: contentVarDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installContextVarFixtures = async () => {
|
export const installContextVarFixtures = async () => {
|
||||||
|
6
api/src/utils/test/fixtures/label.ts
vendored
6
api/src/utils/test/fixtures/label.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -16,7 +16,7 @@ import { FixturesTypeBuilder } from '../types';
|
|||||||
|
|
||||||
type TLabelFixtures = FixturesTypeBuilder<Label, LabelCreateDto>;
|
type TLabelFixtures = FixturesTypeBuilder<Label, LabelCreateDto>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TLabelFixtures['defaultValues'] = {
|
export const contentLabelDefaultValues: TLabelFixtures['defaultValues'] = {
|
||||||
builtin: false,
|
builtin: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ export const labelFixtures = getFixturesWithDefaultValues<
|
|||||||
TLabelFixtures['values']
|
TLabelFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: labels,
|
fixtures: labels,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: contentLabelDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installLabelFixtures = async () => {
|
export const installLabelFixtures = async () => {
|
||||||
|
6
api/src/utils/test/fixtures/nlpsample.ts
vendored
6
api/src/utils/test/fixtures/nlpsample.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -19,7 +19,7 @@ import { installLanguageFixtures } from './language';
|
|||||||
|
|
||||||
type TNlpSampleFixtures = FixturesTypeBuilder<NlpSample, NlpSampleCreateDto>;
|
type TNlpSampleFixtures = FixturesTypeBuilder<NlpSample, NlpSampleCreateDto>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TNlpSampleFixtures['defaultValues'] = {
|
export const nlpSampleDefaultValues: TNlpSampleFixtures['defaultValues'] = {
|
||||||
type: NlpSampleState.train,
|
type: NlpSampleState.train,
|
||||||
trained: false,
|
trained: false,
|
||||||
};
|
};
|
||||||
@ -49,7 +49,7 @@ export const nlpSampleFixtures = getFixturesWithDefaultValues<
|
|||||||
TNlpSampleFixtures['values']
|
TNlpSampleFixtures['values']
|
||||||
>({
|
>({
|
||||||
fixtures: nlpSamples,
|
fixtures: nlpSamples,
|
||||||
defaultValues: fieldsWithDefaultValues,
|
defaultValues: nlpSampleDefaultValues,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const installNlpSampleFixtures = async () => {
|
export const installNlpSampleFixtures = async () => {
|
||||||
|
24
api/src/utils/test/fixtures/subscriber.ts
vendored
24
api/src/utils/test/fixtures/subscriber.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2024 Hexastack. All rights reserved.
|
* Copyright © 2025 Hexastack. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||||
@ -12,19 +12,20 @@ import { SubscriberCreateDto } from '@/chat/dto/subscriber.dto';
|
|||||||
import { Subscriber, SubscriberModel } from '@/chat/schemas/subscriber.schema';
|
import { Subscriber, SubscriberModel } from '@/chat/schemas/subscriber.schema';
|
||||||
|
|
||||||
import { getFixturesWithDefaultValues } from '../defaultValues';
|
import { getFixturesWithDefaultValues } from '../defaultValues';
|
||||||
import { FixturesTypeBuilder, TFixturesDefaultValues } from '../types';
|
import { FixturesTypeBuilder } from '../types';
|
||||||
|
|
||||||
import { installLabelFixtures } from './label';
|
import { installLabelFixtures } from './label';
|
||||||
import { installUserFixtures } from './user';
|
import { installUserFixtures } from './user';
|
||||||
|
|
||||||
type TSubscriberFixtures = FixturesTypeBuilder<Subscriber, SubscriberCreateDto>;
|
type TSubscriberFixtures = FixturesTypeBuilder<Subscriber, SubscriberCreateDto>;
|
||||||
|
|
||||||
export const fieldsWithDefaultValues: TSubscriberFixtures['defaultValues'] = {
|
export const subscriberDefaultValues: TSubscriberFixtures['defaultValues'] = {
|
||||||
context: {},
|
|
||||||
avatar: null,
|
|
||||||
assignedAt: null,
|
|
||||||
assignedTo: null,
|
|
||||||
timezone: 0,
|
timezone: 0,
|
||||||
|
assignedTo: null,
|
||||||
|
assignedAt: null,
|
||||||
|
lastvisit: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
||||||
|
retainedFrom: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
||||||
|
avatar: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const subscribers: TSubscriberFixtures['values'][] = [
|
const subscribers: TSubscriberFixtures['values'][] = [
|
||||||
@ -90,15 +91,6 @@ const subscribers: TSubscriberFixtures['values'][] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const subscriberDefaultValues: TFixturesDefaultValues<Subscriber> = {
|
|
||||||
timezone: 0,
|
|
||||||
assignedTo: null,
|
|
||||||
assignedAt: null,
|
|
||||||
lastvisit: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
||||||
retainedFrom: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000),
|
|
||||||
avatar: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const subscriberFixtures = getFixturesWithDefaultValues<
|
export const subscriberFixtures = getFixturesWithDefaultValues<
|
||||||
TSubscriberFixtures['values']
|
TSubscriberFixtures['values']
|
||||||
>({
|
>({
|
||||||
|
Loading…
Reference in New Issue
Block a user