aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories/FollowKeyRepository.test.ts
blob: 66086624453f466135c67d27ba312cadcbd6e2eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import FollowKeyRepository, {
  FollowKeyRepositoryImpl,
} from "../../../src/content/repositories/FollowKeyRepository";
import { expect } from "chai";

describe("FollowKeyRepositoryImpl", () => {
  let sut: FollowKeyRepository;

  before(() => {
    sut = new FollowKeyRepositoryImpl();
  });

  describe("#getKeys()/#pushKey()/#popKey()", () => {
    it("enqueues keys", () => {
      expect(sut.getKeys()).to.be.empty;

      sut.pushKey("a");
      sut.pushKey("b");
      sut.pushKey("c");
      expect(sut.getKeys()).to.deep.equal(["a", "b", "c"]);

      sut.popKey();
      expect(sut.getKeys()).to.deep.equal(["a", "b"]);

      sut.clearKeys();
      expect(sut.getKeys()).to.be.empty;
    });
  });
});