You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
import { ComponentDatatype } from "../../Source/Cesium.js";
|
|
import { ShowGeometryInstanceAttribute } from "../../Source/Cesium.js";
|
|
|
|
describe("Core/ShowGeometryInstanceAttribute", function () {
|
|
it("constructor", function () {
|
|
var attribute = new ShowGeometryInstanceAttribute(false);
|
|
expect(attribute.componentDatatype).toEqual(
|
|
ComponentDatatype.UNSIGNED_BYTE
|
|
);
|
|
expect(attribute.componentsPerAttribute).toEqual(1);
|
|
expect(attribute.normalize).toEqual(false);
|
|
|
|
expect(attribute.value).toEqual(new Uint8Array([false]));
|
|
});
|
|
|
|
it("toValue", function () {
|
|
var expectedResult = new Uint8Array([true]);
|
|
expect(ShowGeometryInstanceAttribute.toValue(true)).toEqual(expectedResult);
|
|
});
|
|
|
|
it("toValue works with a result parameter", function () {
|
|
var expectedResult = new Uint8Array([true]);
|
|
var result = new Uint8Array(1);
|
|
var returnedResult = ShowGeometryInstanceAttribute.toValue(true, result);
|
|
expect(returnedResult).toEqual(expectedResult);
|
|
expect(returnedResult).toBe(result);
|
|
});
|
|
|
|
it("toValue throws without a color", function () {
|
|
expect(function () {
|
|
ShowGeometryInstanceAttribute.toValue();
|
|
}).toThrowDeveloperError();
|
|
});
|
|
});
|