Add loading component
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
|
||||
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
||||
|
||||
import { VariantAnalysisContainer } from '../../view/variant-analysis/VariantAnalysisContainer';
|
||||
import { VariantAnalysisLoading as VariantAnalysisLoadingComponent } from '../../view/variant-analysis/VariantAnalysisLoading';
|
||||
|
||||
export default {
|
||||
title: 'Variant Analysis/Variant Analysis Loading',
|
||||
component: VariantAnalysisLoadingComponent,
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<VariantAnalysisContainer>
|
||||
<Story />
|
||||
</VariantAnalysisContainer>
|
||||
)
|
||||
],
|
||||
argTypes: {}
|
||||
} as ComponentMeta<typeof VariantAnalysisLoadingComponent>;
|
||||
|
||||
const Template: ComponentStory<typeof VariantAnalysisLoadingComponent> = () => (
|
||||
<VariantAnalysisLoadingComponent />
|
||||
);
|
||||
|
||||
export const VariantAnalysisLoading = Template.bind({});
|
||||
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const FirstRow = styled.div`
|
||||
font-size: x-large;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
margin-bottom: 0.5em;
|
||||
`;
|
||||
|
||||
const SecondRow = styled.div`
|
||||
text-align: center;
|
||||
color: var(--vscode-descriptionForeground);
|
||||
`;
|
||||
|
||||
export const VariantAnalysisLoading = () => {
|
||||
return (
|
||||
<div>
|
||||
<FirstRow>We are getting everything ready</FirstRow>
|
||||
<SecondRow>Results will appear here shortly</SecondRow>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import { render as reactRender, screen } from '@testing-library/react';
|
||||
import { VariantAnalysisLoading } from '../VariantAnalysisLoading';
|
||||
|
||||
describe(VariantAnalysisLoading.name, () => {
|
||||
const render = () =>
|
||||
reactRender(<VariantAnalysisLoading />);
|
||||
|
||||
it('renders loading text', async () => {
|
||||
render();
|
||||
|
||||
expect(screen.getByText('We are getting everything ready')).toBeInTheDocument();
|
||||
expect(screen.getByText('Results will appear here shortly')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user