-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
packages/abstractions/test/common/store/backingStoreUtilsTest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
import { assert } from "chai"; | ||
import { isBackingStoreEnabled } from "../../../src/store/backingStoreUtils"; | ||
import { TestBackedModel, createTestBackedModelFromDiscriminatorValue, createTestParserFromDiscriminatorValue } from "./testEntity"; | ||
import { ParseNode } from "../../../src"; | ||
|
||
it("Test backing store should be enabled if the parsableFactory has backingStore property", async () => { | ||
const testBackedModel = {} as TestBackedModel; | ||
const backingStoreEnabled = isBackingStoreEnabled(testBackedModel, createTestBackedModelFromDiscriminatorValue); | ||
const fields = createTestBackedModelFromDiscriminatorValue({} as ParseNode)(testBackedModel); | ||
const backingStoreEnabled = isBackingStoreEnabled(fields); | ||
assert.isTrue(backingStoreEnabled); | ||
}); | ||
|
||
it("Test backing store should not be enabled if the parsableFactory lacks backingStore property", async () => { | ||
const testBackedModel = {} as TestBackedModel; | ||
const backingStoreEnabled = isBackingStoreEnabled(testBackedModel, createTestParserFromDiscriminatorValue); | ||
const testModel = {} as TestBackedModel; | ||
const fields = createTestParserFromDiscriminatorValue({} as ParseNode)(testModel); | ||
const backingStoreEnabled = isBackingStoreEnabled(fields); | ||
assert.isFalse(backingStoreEnabled); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters