mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
* fix: Theme.name does not match registered name (#6186) * chore(tests): add test for defineTheme normalizing to lower case
This commit is contained in:
@@ -149,6 +149,7 @@ class Theme {
|
||||
* @return {!Theme} A new Blockly theme.
|
||||
*/
|
||||
static defineTheme(name, themeObj) {
|
||||
name = name.toLowerCase();
|
||||
const theme = new Theme(name);
|
||||
let base = themeObj['base'];
|
||||
if (base) {
|
||||
|
||||
@@ -274,4 +274,11 @@ suite('Theme', function() {
|
||||
this.constants.validatedBlockStyle_(inputStyle), expectedOutput);
|
||||
});
|
||||
});
|
||||
|
||||
suite('defineTheme', function() {
|
||||
test('Normalizes to lowercase', function() {
|
||||
const theme = Blockly.Theme.defineTheme('TEST', {});
|
||||
chai.assert.equal(theme.name, 'test');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user