|
1 | 1 | import $ from 'jquery'; |
2 | 2 | import themeModule from 'viz/themes'; |
| 3 | +import { createPalette } from 'viz/palette'; |
3 | 4 | import uiThemeModule from 'ui/themes'; |
4 | 5 |
|
5 | 6 | uiThemeModule.setDefaultTimeout(0); |
@@ -359,16 +360,33 @@ QUnit.test('Invalid input data (with color scheme)', function(assert) { |
359 | 360 | }); |
360 | 361 |
|
361 | 362 | [ |
362 | | - 'fluent-next.blue.light', |
363 | | - 'fluent-next.blue.light.compact', |
364 | | - 'fluent-next.blue.dark', |
365 | | - 'fluent-next.blue.dark.compact', |
366 | | -].forEach((theme) => { |
| 363 | + { theme: 'fluent-next.blue.light', accentColor: '#0F6CBD' }, |
| 364 | + { theme: 'fluent-next.blue.light.compact', accentColor: '#0F6CBD' }, |
| 365 | + { theme: 'fluent-next.blue.dark', accentColor: '#4B90D9' }, |
| 366 | + { theme: 'fluent-next.blue.dark.compact', accentColor: '#4B90D9' }, |
| 367 | +].forEach(({ theme, accentColor }) => { |
367 | 368 | QUnit.test(`fluent-next theme should be registered: ${theme}`, function(assert) { |
368 | 369 | themeModule.currentTheme(theme); |
369 | 370 |
|
370 | 371 | assert.strictEqual(themeModule.currentTheme(), theme); |
371 | 372 | }); |
| 373 | + |
| 374 | + QUnit.test(`fluent-next theme should color series with the Fluent Next palette: ${theme}`, function(assert) { |
| 375 | + const defaultPalette = themeModule.getTheme(theme).defaultPalette; |
| 376 | + |
| 377 | + const colors = createPalette(undefined, {}, defaultPalette).generateColors(6); |
| 378 | + |
| 379 | + assert.deepEqual(colors, ['#0078d4', '#c83d3d', '#008f04', '#eaa300', '#e43ba6', '#865cbf']); |
| 380 | + }); |
| 381 | + |
| 382 | + QUnit.test(`fluent-next theme should accent widgets with its own primary color: ${theme}`, function(assert) { |
| 383 | + const registeredTheme = themeModule.getTheme(theme); |
| 384 | + |
| 385 | + assert.strictEqual(registeredTheme.rangeSelector.selectedRangeColor, accentColor, 'rangeSelector'); |
| 386 | + assert.strictEqual(registeredTheme.map['layer:marker:dot'].color, accentColor, 'map marker'); |
| 387 | + assert.strictEqual(registeredTheme.bullet.color, accentColor, 'bullet'); |
| 388 | + assert.strictEqual(registeredTheme.gauge.valueIndicators.rangebar.color, accentColor, 'gauge'); |
| 389 | + }); |
372 | 390 | }); |
373 | 391 |
|
374 | 392 |
|
|
0 commit comments