require('../../browser/annict.min');

describe('authorization service', () => {

    const annict = new Annict();
    const OAuth  = annict.OAuth;

    it('support authorize', done => {
        window.location.assign = sinon.spy();
        OAuth.authorize();

        expect(window.location.assign).to.have.been.called;
        done();
    });
});

require('../../browser/annict.min');

describe('authorization service', () => {

    const annict = new Annict();
    const OAuth  = annict.OAuth;

    it('token method throw error', done => {
        expect(OAuth.token).to.throw(Error);
        done();
    });

    it('support authorize', done => {
        window.location.assign = sinon.spy();
        OAuth.authorize();

        expect(window.location.assign).to.have.been.called;
        done();
    });
});

test for token method on browser