Skip to content

Commit

Permalink
test: add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Apr 22, 2023
1 parent b282f63 commit ddc4b6a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/utils/merge-locales.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,38 @@ describe('mergeLocales', () => {
});
});

it('should not overwrite not applicable data', () => {
const locale1: LocaleDefinition = {
metadata: { title: 'a' },
location: {
city: null,
country: null,
},
};
const locale2: LocaleDefinition = {
metadata: { title: 'b' },
location: {
city: ['b'],
},
};
const locale3: LocaleDefinition = {
metadata: { title: 'c' },
location: {
city: ['c'],
country: ['c'],
},
};
const merged = mergeLocales([locale1, locale2, locale3]);

expect(merged).toEqual({
metadata: { title: 'a' },
location: {
city: null,
country: null,
},
});
});

it('should extend categories', () => {
const locale1: LocaleDefinition = {
metadata: { title: 'a' },
Expand Down

0 comments on commit ddc4b6a

Please sign in to comment.