Skip to content

Commit

Permalink
test(User): Introduced getLanguage test
Browse files Browse the repository at this point in the history
ElwynVdb committed Apr 25, 2024
1 parent 9c3c7fb commit 42e28a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions __test__/unit/user/user.test.ts
Original file line number Diff line number Diff line change
@@ -54,4 +54,20 @@ describe('User tests', () => {

expect(tags).toBe(tagsSample);
});


test('getLanguage should return the correct user language', async () => {
await TestEnvironment.initialize();

const languageSample = 'fr'

const propertyModel = getDummyPropertyOSModel();
propertyModel.set('language', languageSample);
OneSignal.coreDirector.add(ModelName.Properties, propertyModel);

const user = User.createOrGetInstance();
const language = user.getLanguage();

expect(language).toBe(languageSample);
});
});

0 comments on commit 42e28a7

Please sign in to comment.