Unit Testing: CBT Context Report V3 - CBTYoung/Documentation GitHub Wiki
import AsyncStorage from "@react-native-async-storage/async-storage";
import { Value } from "react-native-reanimated";
import { CBTReportContext } from "../../../src/architecture/business_layer/modules/CBTReportContext";
import { ActiveFill } from "../../../src/architecture/business_layer/modules/ReportStrategies/ActiveFill";
import { BodyPartSelection, bodyParts } from "../../../src/architecture/business_layer/modules/ReportStrategies/BodyPartSelection";
import { DType, getValueofCBTReport, wipe_guest, removeValueofCBTReport, saveValueofCBTReport } from "../../../src/architecture/data_access_layer/local_storage";
1. Active Fill Summary Tests:
describe("Active Fill Summary tests", () => {
beforeEach(()=>{
wipe_guest();
});
test('checking get summary with two reports', () =>{
const date = new Date(Date.now());
const fill = new ActiveFill("feeling good");
expect(fill.getSummary())
.toBe(fill.getSummary());
});
});
Test 1.1: Checking Get Summary With Two Reports
When the system has two reports in it' and we try to read a report, we want it to be the same as the last report we gave it.
Therefore' we expect to get the same report back as we gave.