Skip to content

Commit

Permalink
Add test for conflicting keys
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Jul 18, 2024
1 parent 8cb1ce5 commit 6ceffdf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/extend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,25 @@ test('generated colours are accurate to Catppuccin', () => {
}
}
});

test("conflicting keys don't override existing keys", () => {
const theme = {
colors: {
red: 'meow',
},
} as Record<
'colors',
{
[colour in keyof CatppuccinColors]: string;
} & {
ctp: {
[colour in keyof CatppuccinColors]: string;
};
}
>;

_extendTheme({ defaultFlavour: 'frappe', prefix: false })(theme);

expect(theme.colors.red).toBe('meow');
expect(theme.colors.ctp.red);
});

0 comments on commit 6ceffdf

Please sign in to comment.