Skip to content

Commit

Permalink
chore: Fix codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Apr 23, 2021
1 parent 3b74fc2 commit 9a20028
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/core/e2e/translations.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,36 @@ describe('Translation', () => {
});

it('shall receive german error message', async () => {
const { customErrorMessage } = await adminClient.query(CUSTOM_ERROR, {}, { languageCode: LanguageCode.de });
const { customErrorMessage } = await adminClient.query(
CUSTOM_ERROR,
{},
{ languageCode: LanguageCode.de },
);
expect(customErrorMessage.errorCode).toBe('CUSTOM_ERROR');
expect(customErrorMessage.message).toBe('DE_' + CUSTOM_ERROR_MESSAGE_TRANSLATION);
});
});

describe('translation added by file', () => {
it('shall receive custom error message', async () => {
const { newErrorMessage } = await adminClient.query(NEW_ERROR);
const { newErrorMessage } = await adminClient.query(gql(NEW_ERROR));
expect(newErrorMessage.errorCode).toBe('NEW_ERROR');
expect(newErrorMessage.message).toBe(EN.errorResult.NEW_ERROR);
});

it('shall receive german error message', async () => {
const { newErrorMessage } = await adminClient.query(NEW_ERROR, {}, { languageCode: LanguageCode.de });
const { newErrorMessage } = await adminClient.query(
gql(NEW_ERROR),
{},
{ languageCode: LanguageCode.de },
);
expect(newErrorMessage.errorCode).toBe('NEW_ERROR');
expect(newErrorMessage.message).toBe(DE.errorResult.NEW_ERROR);
});
});

});

const CUSTOM_ERROR = gql`
const CUSTOM_ERROR = `
query CustomError {
customErrorMessage {
... on ErrorResult {
Expand All @@ -74,7 +81,7 @@ const CUSTOM_ERROR = gql`
}
`;

const NEW_ERROR = gql`
const NEW_ERROR = `
query NewError {
newErrorMessage {
... on ErrorResult {
Expand Down

0 comments on commit 9a20028

Please sign in to comment.