@vnejs/plugins.scenario.fastforward 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/modules/visits.ts +2 -1
- package/src/tests/scenario.test.ts +1 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/modules/visits.ts
CHANGED
|
@@ -24,7 +24,8 @@ export class FastforwardVisits extends ModuleCore<
|
|
|
24
24
|
init = () => this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.FASTFORWARD.CHECK_VISITED, value: this.PARAMS.FASTFORWARD.DEFAULT_CHECK_VISITED });
|
|
25
25
|
|
|
26
26
|
onVisitCheck = async () => {
|
|
27
|
-
const isAllowed =
|
|
27
|
+
const isAllowed =
|
|
28
|
+
!this.shared.settings[this.SETTINGS.FASTFORWARD.CHECK_VISITED] || this.shared.fastforwardStorage.has((await hashSha256(this.state)) as string);
|
|
28
29
|
|
|
29
30
|
return { isAllowed, source: this.name } satisfies FastforwardCheckResult;
|
|
30
31
|
};
|
|
@@ -19,7 +19,7 @@ describe("FastforwardScenario", () => {
|
|
|
19
19
|
it("EXEC emits VISIT_ADD with hash of visits state", async () => {
|
|
20
20
|
const { observer } = createFastforwardTestModule(FastforwardScenario, {
|
|
21
21
|
state: {
|
|
22
|
-
scenario: { label: "intro", curLine: 0 },
|
|
22
|
+
"scenario": { label: "intro", curLine: 0 },
|
|
23
23
|
"fastforward.visits": { label: "intro", args: {}, keywords: [] },
|
|
24
24
|
},
|
|
25
25
|
});
|