Sha256: 3d3a92143782aa5c068fdafd19f9512348667277ea331d476bdf3f2d3d5c45b9

Contents?: true

Size: 910 Bytes

Versions: 4

Compression:

Stored size: 910 Bytes

Contents

jest.mock('lanes/models/sync');
jest.mock('lanes/config');

import React  from 'react';

import User        from 'lanes/user';
import Config      from 'lanes/config';
import LoginDialog from 'lanes/access/login-dialog';

describe('Login Dialog', () => {
    beforeEach(() => (Config.access_token = '0123456789'));
    afterEach(() => (Config.access_token = ''));

    it('does not render when user isnt logged in', () => {
        expect(User.isLoggedIn).toBe(true);
        const dialog = shallow(<LoginDialog />);
        expect(dialog).not.toHaveRendered('LoginForm');
    });

    it('is hidden when user logins successfully', () => {
        const dialog = shallow(<LoginDialog />);
        expect(User.isLoggedIn).toEqual(true);
        expect(dialog).not.toHaveRendered('LoginForm');
        User.logout().then(() => {
            expect(dialog).not.toHaveRendered('LoginForm');
        });
    });
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lanes-0.8.3 spec/client/access/login-dialog.spec.jsx
lanes-0.8.2 spec/client/access/login-dialog.spec.jsx
lanes-0.8.1 spec/client/access/login-dialog.spec.jsx
lanes-0.8.0 spec/client/access/login-dialog.spec.jsx