snapshot of https://github.com/twentyhq/twenty.git (main, 2026-09-17; blobs > 131072B omitted)
Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 2s

This commit is contained in:
upstream-mirror
2026-09-17 23:28:13 +05:00
commit e7da97194a
32688 changed files with 4208681 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { NORMALIZATION_RULES } from '../../constants/normalization-rules.constant';
import { evaluateRules } from '../evaluate-rules.util';
describe('evaluateRules', () => {
it('reports every rule that fired and applies them in sequence', () => {
const result = evaluateRules({
rules: NORMALIZATION_RULES,
sourceText: 'Replace `<path>` with your path',
translationText: '\\u62db `&lt;path&gt;`',
});
expect(result.fixedText).toBe('招 `<path>`');
expect(result.ruleNames).toEqual([
'escaped-unicode',
'escaped-inline-code-tags',
]);
});
it('skips source-filtered rules when the source string is unknown', () => {
const result = evaluateRules({
rules: NORMALIZATION_RULES,
sourceText: undefined,
translationText: 'Remplacez `&lt;path&gt;` par votre chemin',
});
expect(result.ruleNames).toEqual([]);
});
it('skips source-filtered rules when the source does not match', () => {
const result = evaluateRules({
rules: NORMALIZATION_RULES,
sourceText: 'Escape a literal &lt; in prose',
translationText: 'Échappez un &lt; littéral dans le texte',
});
expect(result.ruleNames).toEqual([]);
});
it('returns the translation untouched when no rule fires', () => {
const result = evaluateRules({
rules: NORMALIZATION_RULES,
sourceText: 'Replace `<path>` with your path',
translationText: 'Remplacez `<path>` par votre chemin',
});
expect(result.fixedText).toBe('Remplacez `<path>` par votre chemin');
expect(result.ruleNames).toEqual([]);
});
});

View File

@@ -0,0 +1,67 @@
import { CrowdinApiError } from '../../errors/crowdin-api.error';
import { isTranslationAlreadyPresentError } from '../is-translation-already-present-error.util';
const buildError = (body: string) => new CrowdinApiError(400, body);
const buildDetailError = (detail: { code: string; message: string }) =>
buildError(
JSON.stringify({
errors: [{ error: { key: 'translation', errors: [detail] } }],
}),
);
describe('isTranslationAlreadyPresentError', () => {
it('recognises the identical-translation error code', () => {
expect(
isTranslationAlreadyPresentError(
buildDetailError({
code: 'identicalTranslation',
message: 'Identical translation already saved',
}),
),
).toBe(true);
});
it('recognises the duplicate-translation validation error', () => {
expect(
isTranslationAlreadyPresentError(
buildDetailError({
code: 'validationError',
message:
'Duplicate translation. Please vote or approve the original.',
}),
),
).toBe(true);
});
it('does not swallow an unrelated validation error', () => {
expect(
isTranslationAlreadyPresentError(
buildDetailError({
code: 'validationError',
message: 'Translation is too long',
}),
),
).toBe(false);
});
it('does not treat another failure as present because of its wording', () => {
expect(
isTranslationAlreadyPresentError(
buildDetailError({
code: 'notFound',
message: 'String is identical to a deleted one',
}),
),
).toBe(false);
});
it('rejects a non-JSON body and any non-Crowdin error', () => {
expect(
isTranslationAlreadyPresentError(buildError('<html>502</html>')),
).toBe(false);
expect(isTranslationAlreadyPresentError(new Error('identical'))).toBe(
false,
);
});
});

View File

@@ -0,0 +1,51 @@
import { mapWithConcurrency } from '../map-with-concurrency.util';
describe('mapWithConcurrency', () => {
it('keeps results in input order regardless of completion order', async () => {
const results = await mapWithConcurrency({
items: [30, 10, 20],
limit: 3,
handler: (delay) =>
new Promise<number>((resolve) =>
setTimeout(() => resolve(delay), delay),
),
});
expect(results).toEqual([30, 10, 20]);
});
it('never runs more than `limit` handlers at once', async () => {
let running = 0;
let peak = 0;
await mapWithConcurrency({
items: Array.from({ length: 20 }, (_, index) => index),
limit: 3,
handler: async (item) => {
running++;
peak = Math.max(peak, running);
await new Promise((resolve) => setTimeout(resolve, 1));
running--;
return item;
},
});
expect(peak).toBe(3);
});
it('rejects a limit that would leave every item unhandled', async () => {
await expect(
mapWithConcurrency({ items: [1], limit: 0, handler: jest.fn() }),
).rejects.toThrow('at least 1');
});
it('returns an empty array without spawning workers', async () => {
const handler = jest.fn();
expect(await mapWithConcurrency({ items: [], limit: 5, handler })).toEqual(
[],
);
expect(handler).not.toHaveBeenCalled();
});
});