aboutsummaryrefslogtreecommitdiff
path: root/test/content/repositories/FollowKeyRepository.test.ts
blob: eae58b99aebd0b51c527d2017644147908b742cb (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
30
31
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;
    });
  });
});