mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +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:
|
||||
* 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
|
||||
>;
|
||||
|
||||
export const fieldsWithDefaultValues: TCategoryFixtures['defaultValues'] = {
|
||||
export const categoryDefaultValues: TCategoryFixtures['defaultValues'] = {
|
||||
builtin: false,
|
||||
zoom: 100,
|
||||
offset: [0, 0],
|
||||
@ -38,7 +38,7 @@ export const categoryFixtures = getFixturesWithDefaultValues<
|
||||
TCategoryFixtures['values']
|
||||
>({
|
||||
fixtures: categories,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: categoryDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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>;
|
||||
|
||||
export const fieldsWithDefaultValues: TContentFixtures['defaultValues'] = {
|
||||
export const contentDefaultValues: TContentFixtures['defaultValues'] = {
|
||||
status: true,
|
||||
};
|
||||
|
||||
@ -141,7 +141,7 @@ export const contentFixtures = getFixturesWithDefaultValues<
|
||||
TContentFixtures['values']
|
||||
>({
|
||||
fixtures: contents,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: contentDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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
|
||||
>;
|
||||
|
||||
export const fieldsWithDefaultValues: TContentTypeFixtures['defaultValues'] = {
|
||||
export const contentTypeDefaultValues: TContentTypeFixtures['defaultValues'] = {
|
||||
fields: [
|
||||
{
|
||||
name: 'title',
|
||||
@ -124,7 +124,7 @@ export const contentTypeFixtures = getFixturesWithDefaultValues<
|
||||
TContentTypeFixtures['values']
|
||||
>({
|
||||
fixtures: contentTypes,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: contentTypeDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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>;
|
||||
|
||||
export const fieldsWithDefaultValues: TContentVarFixtures['defaultValues'] = {
|
||||
export const contentVarDefaultValues: TContentVarFixtures['defaultValues'] = {
|
||||
permanent: false,
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ export const contextVarFixtures = getFixturesWithDefaultValues<
|
||||
TContentVarFixtures['values']
|
||||
>({
|
||||
fixtures: contextVars,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: contentVarDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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>;
|
||||
|
||||
export const fieldsWithDefaultValues: TLabelFixtures['defaultValues'] = {
|
||||
export const contentLabelDefaultValues: TLabelFixtures['defaultValues'] = {
|
||||
builtin: false,
|
||||
};
|
||||
|
||||
@ -49,7 +49,7 @@ export const labelFixtures = getFixturesWithDefaultValues<
|
||||
TLabelFixtures['values']
|
||||
>({
|
||||
fixtures: labels,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: contentLabelDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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>;
|
||||
|
||||
export const fieldsWithDefaultValues: TNlpSampleFixtures['defaultValues'] = {
|
||||
export const nlpSampleDefaultValues: TNlpSampleFixtures['defaultValues'] = {
|
||||
type: NlpSampleState.train,
|
||||
trained: false,
|
||||
};
|
||||
@ -49,7 +49,7 @@ export const nlpSampleFixtures = getFixturesWithDefaultValues<
|
||||
TNlpSampleFixtures['values']
|
||||
>({
|
||||
fixtures: nlpSamples,
|
||||
defaultValues: fieldsWithDefaultValues,
|
||||
defaultValues: nlpSampleDefaultValues,
|
||||
});
|
||||
|
||||
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:
|
||||
* 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 { getFixturesWithDefaultValues } from '../defaultValues';
|
||||
import { FixturesTypeBuilder, TFixturesDefaultValues } from '../types';
|
||||
import { FixturesTypeBuilder } from '../types';
|
||||
|
||||
import { installLabelFixtures } from './label';
|
||||
import { installUserFixtures } from './user';
|
||||
|
||||
type TSubscriberFixtures = FixturesTypeBuilder<Subscriber, SubscriberCreateDto>;
|
||||
|
||||
export const fieldsWithDefaultValues: TSubscriberFixtures['defaultValues'] = {
|
||||
context: {},
|
||||
avatar: null,
|
||||
assignedAt: null,
|
||||
assignedTo: null,
|
||||
export const subscriberDefaultValues: TSubscriberFixtures['defaultValues'] = {
|
||||
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'][] = [
|
||||
@ -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<
|
||||
TSubscriberFixtures['values']
|
||||
>({
|
||||
|
Loading…
Reference in New Issue
Block a user