Skip to content

Commit 5017ec1

Browse files
committed
WIP - hugs.localdomain Wed, Jun 05 04:56 pm
[no-changelog-required]
1 parent fc67d91 commit 5017ec1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

spec/class-model-snapshotted-views.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ class Outer extends ClassModel({ name: types.string, examples: types.array(ViewE
2424
}
2525

2626
describe("class model snapshotted views", () => {
27-
describe.each([
28-
["read-only", true],
29-
["observable", false],
30-
])("%s", (_name, readOnly) => {
27+
// describe.each([
28+
// ["read-only", true],
29+
// ["observable", false],
30+
// ])("%s", (_name, readOnly) => {
31+
describe("whatever", () => {
32+
const readOnly = false;
33+
3134
test("instances don't require the snapshot to include the cache", () => {
3235
const instance = create(ViewExample, { key: "1", name: "Test" }, readOnly);
3336
expect(instance.slug).toEqual("test");
@@ -114,6 +117,7 @@ describe("class model snapshotted views", () => {
114117
// expect(AllOptionalB.is(instanceB)).toBe(false);
115118
// });
116119
});
120+
117121
test("an observable instance saves the view value in a snapshot when changed", () => {
118122
const instance = ViewExample.create({ key: "1", name: "Test" });
119123
expect(instance.slug).toEqual("test");

src/class-model.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ export const isClassModel = (type: IAnyType): type is IClassModelType<any, any,
517517
const buildSnapshottedViewProcessor = (snapshottedViews: SnapshottedViewMetadata[], mstType: MSTIModelType<any, any>) => {
518518
return mstTypes.snapshotProcessor(mstType, {
519519
postProcessor(snapshot, node) {
520-
if (!node) return snapshot; // FIXME -- undesirable to ever run without a node because we are thusly not putting a snapshot of the view in the snapshot
520+
if (!node) {
521+
debugger;
522+
return snapshot; // FIXME -- undesirable to ever run without a node because we are thusly not putting a snapshot of the view in the snapshot
523+
}
521524
for (const snapshottedView of snapshottedViews) {
522525
storeViewOnSnapshot(node, snapshottedView, snapshot);
523526
}

0 commit comments

Comments
 (0)