Skip to content

Commit

Permalink
test(task): adapter toJson
Browse files Browse the repository at this point in the history
  • Loading branch information
acellam committed Aug 16, 2024
1 parent c2bd415 commit 34af85c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions components/task/tests/adapters/task_adapter.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { expect } from "chai";
import { taskOne } from "../factories/tasks/task_data";
import { TaskAdapter } from "./../../../../components/task/adapters/task_adapter";
import { TaskEntity } from "./../../../../components/task/public/entities/task_entity";

describe("Task Adapter", () => {
const taskEntity: TaskEntity = new TaskEntity(
taskOne.name,
taskOne.description
);
const taskAdapter: TaskAdapter = new TaskAdapter(taskEntity);

context("toJson()", async () => {

describe("should render list of tasks as JSON", async () => {

const result = await taskAdapter.toJson();

expect(result).to.deep.equal(JSON.stringify(taskOne));
});
});
});

0 comments on commit 34af85c

Please sign in to comment.