Skip to content

Commit 9d5a319

Browse files
committed
added more tests
1 parent b8bc2dc commit 9d5a319

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/v6.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ describe("Testing transmission of control sequences", function () {
141141
done();
142142
});
143143

144+
it("shall transform RGB to milight hue", function (done) {
145+
expect(index.helper.rgbToHue.apply(index.helper, [255, 0, 0])).toBe(0xB0);
146+
done();
147+
});
148+
149+
it("shall transform RGB to Milight full color HSV", function (done) {
150+
expect(index.helper.rgbToFullColorHsv.apply(index.helper, [255, 0, 0])[0]).toBe(0xB0);
151+
done();
152+
});
153+
154+
it("shall transform RGB to Milight full color HSV", function (done) {
155+
expect(index.helper.rgbToFullColorHsv.apply(index.helper, [0, 255, 255])[0]).toBe(0x133);
156+
done();
157+
});
158+
144159
it("shall retry if no response", function (done) {
145160
var myLight = new Milight({
146161
type: 'v6'

0 commit comments

Comments
 (0)