mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -04:00
6b0c3032b2
* feat(explore): Use v1/explore endpoint data instead of bootstrapData * Add tests * Fix ci * Remove redundant dependency * Use form_data_key in cypress tests * Add auth headers to for data request * Address comments * Remove displaying danger toast * Conditionally add auth headers * Address comments * Fix typing bug * fix * Fix opening dataset * Fix sqllab chart create * Run queries in parallel * Fallback to default color scheme * Fix dashboard id autofill * Fix lint * Fix test * Fix hydrate action * Update dashboard colors * Add color scheme domain * Add check for default scheme * Make me pretty * Clean up * Nit * Clean up * Pretty * Fix missing sequential * Lint * Enhance test * Lint Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
/*
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
* or more contributor license agreements. See the NOTICE file
|
|
* distributed with this work for additional information
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
* to you under the Apache License, Version 2.0 (the
|
|
* "License"); you may not use this file except in compliance
|
|
* with the License. You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
import ColorSchemeRegistry from '../../src/color/ColorSchemeRegistry';
|
|
import schemes from '../../src/color/colorSchemes/categorical/d3';
|
|
import CategoricalScheme from '../../src/color/CategoricalScheme';
|
|
|
|
describe('ColorSchemeRegistry', () => {
|
|
it('exists', () => {
|
|
expect(ColorSchemeRegistry).toBeDefined();
|
|
expect(ColorSchemeRegistry).toBeInstanceOf(Function);
|
|
});
|
|
it('returns undefined', () => {
|
|
const registry = new ColorSchemeRegistry();
|
|
expect(registry.get('something')).toBeUndefined();
|
|
});
|
|
it('returns default', () => {
|
|
const registry = new ColorSchemeRegistry();
|
|
registry.registerValue('SUPERSET_DEFAULT', schemes[0]);
|
|
expect(registry.get('something')).toBeInstanceOf(CategoricalScheme);
|
|
});
|
|
it('returns undefined in strict mode', () => {
|
|
const registry = new ColorSchemeRegistry();
|
|
registry.registerValue('SUPERSET_DEFAULT', schemes[0]);
|
|
expect(registry.get('something', true)).toBeUndefined();
|
|
});
|
|
});
|