-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into inf-291-nc-artifacts
- Loading branch information
Showing
8 changed files
with
170 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -563,6 +563,7 @@ | |
"restapi", | ||
"ringcentral", | ||
"reshard", | ||
"userid", | ||
"endgroup", | ||
"aliyun", | ||
"azcopy", | ||
|
Submodule .source
updated
from f0ced1 to f33cf8
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
52 changes: 52 additions & 0 deletions
52
apps/api/src/app/testing/translations/update-default-locale.e2e-ee.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,52 @@ | ||
import { UserSession } from '@novu/testing'; | ||
import { expect } from 'chai'; | ||
import { OrganizationRepository } from '@novu/dal'; | ||
|
||
describe('Update default locale and add new translations - /translations/language (PATCH)', async () => { | ||
let session: UserSession; | ||
const organizationRepository = new OrganizationRepository(); | ||
|
||
before(async () => { | ||
session = new UserSession(); | ||
await session.initialize(); | ||
await session.testAgent.put(`/v1/organizations/language`).send({ | ||
locale: 'en_US', | ||
}); | ||
}); | ||
|
||
it('should update default locale and add that locale to groups', async () => { | ||
await session.testAgent.post(`/v1/translations/groups`).send({ | ||
name: 'test', | ||
identifier: 'test', | ||
locales: ['en_US', 'sv_SE'], | ||
}); | ||
|
||
await session.applyChanges({ | ||
enabled: false, | ||
}); | ||
|
||
await session.testAgent.patch(`/v1/translations/language`).send({ | ||
locale: 'en_GB', | ||
}); | ||
|
||
const org = await organizationRepository.findById(session.organization._id); | ||
expect(org?.defaultLocale).to.be.equal('en_GB'); | ||
|
||
const result = await session.testAgent.get(`/v1/translations/groups/test`).send(); | ||
let group = result.body.data; | ||
|
||
let locales = group.translations.map((t) => t.isoLanguage); | ||
|
||
expect(locales).to.deep.equal(['en_US', 'sv_SE', 'en_GB']); | ||
|
||
await session.applyChanges({ | ||
enabled: false, | ||
}); | ||
await session.switchToProdEnvironment(); | ||
|
||
const data = await session.testAgent.get(`/v1/translations/groups/test`).send(); | ||
group = data.body.data; | ||
locales = group.translations.map((t) => t.isoLanguage); | ||
expect(locales).to.deep.equal(['en_US', 'sv_SE', 'en_GB']); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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