-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed unnecessary eslint exception * Renamed spec file to match the tested file * Renamed describe to match test * Prepared test, removed eslint exceptions * Prepared fixture abstraction * Created SaveEntityTranslationPending use case * Prepared RequestEntityTranslation to use saveEntityTranslationPending. * Changed implementation to work with array of languages * Added logic to save AI Translation pending to Request Entity Translation. * Renamed file to plural * Removed standalone use case and included it in Request
- Loading branch information
Showing
9 changed files
with
129 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/api/externalIntegrations.v2/automaticTranslation/specs/fixtures/SaveEntity.fixtures.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { getFixturesFactory } from 'api/utils/fixturesFactory'; | ||
import { LanguageISO6391 } from 'shared/types/commonTypes'; | ||
|
||
export const saveEntityFixtures = (factory: ReturnType<typeof getFixturesFactory>) => ({ | ||
templates: [ | ||
factory.template('template1', [ | ||
{ | ||
_id: factory.id('propertyName'), | ||
name: 'propertyName', | ||
type: 'text', | ||
label: 'Prop 1', | ||
}, | ||
]), | ||
], | ||
entities: [ | ||
...factory.entityInMultipleLanguages(['en', 'pt', 'es'], 'entity', 'template1', { | ||
propertyName: [{ value: 'original text' }], | ||
}), | ||
...factory.entityInMultipleLanguages( | ||
['en', 'pt', 'es'], | ||
'entity_with_wrong_template', | ||
'wrong_template', | ||
{ | ||
propertyName: [{ value: 'original text' }], | ||
} | ||
), | ||
], | ||
settings: [ | ||
{ | ||
languages: [ | ||
{ label: 'en', key: 'en' as LanguageISO6391, default: true }, | ||
{ label: 'pt', key: 'pt' as LanguageISO6391 }, | ||
{ label: 'es', key: 'es' as LanguageISO6391 }, | ||
], | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters