mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
29 lines
647 B
TypeScript
29 lines
647 B
TypeScript
|
import cssToTheme from './cssToTheme';
|
||
|
|
||
|
describe('cssToTheme', function() {
|
||
|
|
||
|
it('should convert a CSS string to a theme', async () => {
|
||
|
const input = `
|
||
|
:root {
|
||
|
--joplin-appearence: light;
|
||
|
--joplin-color: #333333;
|
||
|
--joplin-background-color: #778899;
|
||
|
|
||
|
/* Should skip this comment and empty lines */
|
||
|
|
||
|
--joplin-background-color-transparent: rgba(255,255,255,0.9);
|
||
|
}`;
|
||
|
|
||
|
const expected = {
|
||
|
appearence: 'light',
|
||
|
color: '#333333',
|
||
|
backgroundColor: '#778899',
|
||
|
backgroundColorTransparent: 'rgba(255,255,255,0.9)',
|
||
|
};
|
||
|
|
||
|
const actual = cssToTheme(input, 'test.css');
|
||
|
expect(actual).toEqual(expected);
|
||
|
});
|
||
|
|
||
|
});
|