Sha256: 5b85d8f6586362b5f8fcd11fd5e8e00c61c54bd161bd95d056c0395cc50751fd

Contents?: true

Size: 967 Bytes

Versions: 5

Compression:

Stored size: 967 Bytes

Contents

import React from 'react';

import NetworkActivityOverlay from 'hippo/components/network-activity-overlay';
import { Box } from '../test-models';
import { Snapshot } from 'hippo/testing/screens';

jest.useFakeTimers();

describe('Network Activity Overlay', () => {
    let model;
    beforeEach(() => {
        model = new Box();
    });

    it('renders', () => {
        const activity = mount(<NetworkActivityOverlay model={model} />);
        expect(activity).not.toHaveRendered('.mask');
        model.syncInProgress = { method: 'PUT' };
        expect(activity).toHaveRendered('.mask');
        expect(activity.find('span').text()).toEqual('Saving…');
        jest.runAllTimers();
        expect(activity).not.toHaveRendered('.mask');
    });

    it('matches snapshot', () => {
        model.syncInProgress = { method: 'DELETE' };
        jest.runAllTimers();
        expect(Snapshot(<NetworkActivityOverlay model={model} />)).toMatchSnapshot();
    });
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hippo-fw-0.9.5 spec/client/components/network-activity-overlay.spec.jsx
hippo-fw-0.9.4 spec/client/components/network-activity-overlay.spec.jsx
hippo-fw-0.9.3 spec/client/components/network-activity-overlay.spec.jsx
hippo-fw-0.9.2 spec/client/components/network-activity-overlay.spec.jsx
hippo-fw-0.9.1 spec/client/components/network-activity-overlay.spec.jsx