feat(change_detector): add a way to inspect records and record ranges
This commit is contained in:
@ -9,7 +9,8 @@ import {
|
||||
ChangeDetector,
|
||||
ProtoRecordRange,
|
||||
RecordRange,
|
||||
ProtoRecord
|
||||
ProtoRecord,
|
||||
RECORD_TYPE_CONST
|
||||
} from 'change_detection/change_detector';
|
||||
|
||||
import {Record} from 'change_detection/record';
|
||||
@ -337,5 +338,26 @@ export function main() {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("inspect", () => {
|
||||
it("should return the description of the record", () => {
|
||||
var proto = new ProtoRecord(null, RECORD_TYPE_CONST, 1, 0, "name", null, "group", "expression");
|
||||
var record = new Record(null, proto, null);
|
||||
|
||||
var i = record.inspect();
|
||||
expect(i.description).toContain("const, name, enabled");
|
||||
});
|
||||
|
||||
it("should return the description of the records in the range", () => {
|
||||
var proto = new ProtoRecord(null, RECORD_TYPE_CONST, 1, 0, "name", null, "group", "expression");
|
||||
var record = new Record(null, proto, null);
|
||||
var range = new RecordRange(null, null);
|
||||
range.addRecord(record);
|
||||
|
||||
var i = range.inspect();;
|
||||
expect(i.length).toEqual(1);
|
||||
expect(i[0]).toContain("const, name, enabled");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user