Skip to content

Commit ede01c2

Browse files
committed
fix: rest of Chai 4 has.nested.properties
1 parent 89b982e commit ede01c2

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

test/127506_dc_detailed_status.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ describe('127506 dc detailed status', function () {
77
it('complete sentence converts', function () {
88
var tree = require("../n2kMapper.js").toNested(
99
JSON.parse('{"timestamp":"2016-08-22T16:02:55.272Z","prio":6,"src":17,"dst":255,"pgn":127506,"description":"DC Detailed Status","fields":{"DC Instance":1,"State of Charge":60,"State of Health":99,"Time Remaining": 600, "Ripple Voltage": 10.9, "SID":0}}'));
10-
tree.should.have.deep.property('electrical.batteries.1.capacity.stateOfCharge.value', 60);
11-
tree.should.have.deep.property('electrical.batteries.1.capacity.stateOfHealth.value', 99);
12-
tree.should.have.deep.property('electrical.batteries.1.capacity.timeRemaining.value', 600);
13-
//tree.should.have.deep.property('electrical.batteries.1.voltage.ripple.value', 10.9);
10+
tree.should.have.nested.property('electrical.batteries.1.capacity.stateOfCharge.value', 60);
11+
tree.should.have.nested.property('electrical.batteries.1.capacity.stateOfHealth.value', 99);
12+
tree.should.have.nested.property('electrical.batteries.1.capacity.timeRemaining.value', 600);
13+
//tree.should.have.nested.property('electrical.batteries.1.voltage.ripple.value', 10.9);
1414
tree.should.be.validSignalKVesselIgnoringIdentity;
1515
});
1616
});

test/130820_fusion.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,78 +14,78 @@ describe('130820 Fusion Stereo', function () {
1414
it('complet current source sentence converts', function () {
1515
var tree = require("../n2kMapper.js").toNested(
1616
JSON.parse('{"timestamp":"2016-11-26T20:40:00.901Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Source Name","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Source","A":128,"Source ID":4,"Current Source ID":4,"D":3,"E":5,"Source":"SiriusXM"}}'));
17-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone2.source.value', 'entertainment.device.fusion1.avsource.source4');
18-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.name.value', "SiriusXM");
17+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone2.source.value', 'entertainment.device.fusion1.avsource.source4');
18+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.name.value', "SiriusXM");
1919
//tree.should.be.validSignalKVesselIgnoringIdentity;
2020
});
2121

2222

2323
it('complet SiriusXM channel sentence converts', function () {
2424
var tree = require("../n2kMapper.js").toNested(
2525
JSON.parse('{"timestamp":"2016-11-26T20:40:00.906Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: SiriusXM Channel","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"SiriusXM Channel","A":6554752,"Channel":"xL Howard 100"}}'));
26-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.tuner.stationName.value', 'xL Howard 100');
26+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.tuner.stationName.value', 'xL Howard 100');
2727
//tree.should.be.validSignalKVesselIgnoringIdentity;
2828
});
2929

3030
it('complet SiriusXM Genre sentence converts', function () {
3131
var tree = require("../n2kMapper.js").toNested(
3232
JSON.parse('{"timestamp":"2016-11-26T20:40:00.911Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: SiriusXM Genre","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"SiriusXM Genre","A":6554752,"Genre":"Howard Stern"}}'));
33-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.track.genre.value', 'Howard Stern');
33+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.track.genre.value', 'Howard Stern');
3434
//tree.should.be.validSignalKVesselIgnoringIdentity;
3535
});
3636

3737
it('complet SiriusXM title sentence converts', function () {
3838
var tree = require("../n2kMapper.js").toNested(
3939
JSON.parse('{"timestamp":"2016-11-26T20:40:00.915Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: SiriusXM Title","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"SiriusXM Title","A":6554752,"Title":"A title"}}'));
40-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.track.name.value', 'A title');
40+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.track.name.value', 'A title');
4141
//tree.should.be.validSignalKVesselIgnoringIdentity;
4242
});
4343

4444
it('complet SiriusXM Artist sentence converts', function () {
4545
var tree = require("../n2kMapper.js").toNested(
4646
JSON.parse('{"timestamp":"2016-11-26T20:40:00.918Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: SiriusXM Artist","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"SiriusXM Artist","A":6554752,"Artist":"Howard Stern"}}'));
47-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.track.artistName.value', 'Howard Stern');
47+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.track.artistName.value', 'Howard Stern');
4848
//tree.should.be.validSignalKVesselIgnoringIdentity;
4949
});
5050

5151
it('complet mute sentence converts', function () {
5252
var tree = require("../n2kMapper.js").toNested(
5353
JSON.parse('{"timestamp":"2016-11-26T20:40:00.973Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Mute","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Mute","A":128,"Mute":"Not Muted"}}'));
54-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.isMuted.value', false);
54+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.isMuted.value', false);
5555
//tree.should.be.validSignalKVesselIgnoringIdentity;
5656
});
5757

5858
it('complete equalizer sentence converts', function () {
5959
var tree = require("../n2kMapper.js").toNested(
6060
JSON.parse('{"timestamp":"2016-11-26T20:40:00.986Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Tone","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Tone","A":128,"B":3,"Bass":1,"Mid":2,"Treble":3}}'));
61-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.equalizer.bass', 1);
62-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.equalizer.mid', 2);
63-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.equalizer.treble', 3);
61+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.equalizer.bass', 1);
62+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.equalizer.mid', 2);
63+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.equalizer.treble', 3);
6464
//tree.should.be.validSignalKVesselIgnoringIdentity;
6565
});
6666

6767
it('complet volume sentence converts', function () {
6868
var tree = require("../n2kMapper.js").toNested(
6969
JSON.parse('{"timestamp":"2016-11-26T20:40:00.991Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Volume","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Volume","A":128,"Zone 1":10,"Zone 2":11,"Zone 3":12,"Zone 4":13}}'));
70-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.volume.master.value', 10);
71-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone2.volume.master.value', 11);
72-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone3.volume.master.value', 12);
73-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone4.volume.master.value', 13);
70+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.volume.master.value', 10);
71+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone2.volume.master.value', 11);
72+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone3.volume.master.value', 12);
73+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone4.volume.master.value', 13);
7474
//tree.should.be.validSignalKVesselIgnoringIdentity;
7575
});
7676

7777
it('complet zone name sentence converts', function () {
7878
var tree = require("../n2kMapper.js").toNested(
7979
JSON.parse('{"timestamp":"2016-11-26T20:40:00.996Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Zone Name","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Zone Name","A":128,"Number":0,"Name":"Cockpit"}}'));
80-
tree.should.have.deep.property('entertainment.device.fusion1.output.zone1.name.value', 'Cockpit');
80+
tree.should.have.nested.property('entertainment.device.fusion1.output.zone1.name.value', 'Cockpit');
8181
//tree.should.be.validSignalKVesselIgnoringIdentity;
8282
});
8383

8484

8585
it('complet track name sentence converts', function () {
8686
var tree = require("../n2kMapper.js").toNested(
8787
JSON.parse('{"timestamp":"2016-11-12T20:26:52.150Z","prio":7,"src":10,"dst":255,"pgn":130820,"description":"Fusion: Track","fields":{"Manufacturer Code":"Fusion","Industry Code":"Marine Industry","Message ID":"Track Title","A":128,"B":3592,"Track":"Flow"}}'));
88-
tree.should.have.deep.property('entertainment.device.fusion1.avsource.source4.track.name.value', 'Flow');
88+
tree.should.have.nested.property('entertainment.device.fusion1.avsource.source4.track.name.value', 'Flow');
8989
//tree.should.be.validSignalKVesselIgnoringIdentity;
9090
});
9191

0 commit comments

Comments
 (0)