Unit Testing: Automatic Thoughts - CBTYoung/Documentation GitHub Wiki

import { AutomaticThoughts } from "../../../src/architecture/business_layer/modules/AutomaticThoughts";

describe("AutomaticThoughts Summary tests", () => {
       
    test('checking getsummary with thought', () =>{
        const date = new Date(Date.now());
        const thought ="I'm pretty";
        const auto = new AutomaticThoughts(date, thought);
        expect(auto.getSummary())
        .toBe(date.toString()+":\n"+"I'm pretty");
    });

    test('checking getsummary with set thought', () =>{
        const date = new Date(Date.now());
        const thought ="I'm pretty";
        const auto = new AutomaticThoughts(date, thought);
        const setTh ="I'm pretty sad";
        auto.setThought(setTh);
        expect(auto.getSummary())
        .toBe(date.toString()+":\n"+"I'm pretty sad");
    });
});