Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tape('XVIZStyleParser#Stylesheet#getPropertyDefault', t => {
let stylesheet = new Stylesheet();
t.is(stylesheet.getPropertyDefault('radius'), 1, 'gets correct radius');
t.deepEquals(
stylesheet.getPropertyDefault('fill_color'),
[255, 255, 255],
'gets correct fill color'
);
t.deepEquals(
stylesheet.getPropertyDefault('point_color_domain'),
[0, 0],
'gets correct point color domain'
);
stylesheet = new Stylesheet([
{
style: {point_color_mode: 'elevation'}
}
]);
t.deepEquals(
stylesheet.getPropertyDefault('point_color_domain'),
[0, 3],
'gets correct point color domain'
);
t.end();
});
tape('XVIZStyleParser#Stylesheet', t => {
for (const testData of TEST_STYLESHEETS) {
t.comment(testData.title);
const stylesheet = new Stylesheet(testData.stylesheet);
t.ok(stylesheet, 'Stylesheet constructor does not throw error');
t.is(stylesheet.getPropertyDefault('opacity'), 1, 'returns default property value');
GET_PROPERTY_TEST_CASES.forEach(testCase => {
t.deepEquals(
stylesheet.getProperty(testCase.propertyName, testCase.state),
testCase.output,
'getProperty returns correct value'
);
});
GET_DEPS_TEST_CASES.forEach(testCase => {
t.deepEquals(
stylesheet.getPropertyDependencies(testCase.propertyName),
testCase.output,
tape('XVIZStyleParser#Stylesheet#getPropertyDefault', t => {
let stylesheet = new Stylesheet();
t.is(stylesheet.getPropertyDefault('radius'), 1, 'gets correct radius');
t.deepEquals(
stylesheet.getPropertyDefault('fill_color'),
[255, 255, 255],
'gets correct fill color'
);
t.deepEquals(
stylesheet.getPropertyDefault('point_color_domain'),
[0, 0],
'gets correct point color domain'
);
stylesheet = new Stylesheet([
{
style: {point_color_mode: 'elevation'}
}