Skip to content

Commit f8f81cf

Browse files
Add loading component
1 parent 8c7c197 commit f8f81cf

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
3+
import { ComponentMeta, ComponentStory } from '@storybook/react';
4+
5+
import { VariantAnalysisContainer } from '../../view/variant-analysis/VariantAnalysisContainer';
6+
import { VariantAnalysisLoading as VariantAnalysisLoadingComponent } from '../../view/variant-analysis/VariantAnalysisLoading';
7+
8+
export default {
9+
title: 'Variant Analysis/Variant Analysis Loading',
10+
component: VariantAnalysisLoadingComponent,
11+
decorators: [
12+
(Story) => (
13+
<VariantAnalysisContainer>
14+
<Story />
15+
</VariantAnalysisContainer>
16+
)
17+
],
18+
argTypes: {}
19+
} as ComponentMeta<typeof VariantAnalysisLoadingComponent>;
20+
21+
const Template: ComponentStory<typeof VariantAnalysisLoadingComponent> = () => (
22+
<VariantAnalysisLoadingComponent />
23+
);
24+
25+
export const VariantAnalysisLoading = Template.bind({});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from 'react';
2+
import styled from 'styled-components';
3+
4+
const FirstRow = styled.div`
5+
font-size: x-large;
6+
font-weight: 600;
7+
text-align: center;
8+
margin-bottom: 0.5em;
9+
`;
10+
11+
const SecondRow = styled.div`
12+
text-align: center;
13+
color: var(--vscode-descriptionForeground);
14+
`;
15+
16+
export const VariantAnalysisLoading = () => {
17+
return (
18+
<div>
19+
<FirstRow>We are getting everything ready</FirstRow>
20+
<SecondRow>Results will appear here shortly</SecondRow>
21+
</div>
22+
);
23+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from 'react';
2+
import { render as reactRender, screen } from '@testing-library/react';
3+
import { VariantAnalysisLoading } from '../VariantAnalysisLoading';
4+
5+
describe(VariantAnalysisLoading.name, () => {
6+
const render = () =>
7+
reactRender(<VariantAnalysisLoading />);
8+
9+
it('renders loading text', async () => {
10+
render();
11+
12+
expect(screen.getByText('We are getting everything ready')).toBeInTheDocument();
13+
expect(screen.getByText('Results will appear here shortly')).toBeInTheDocument();
14+
});
15+
});

0 commit comments

Comments
 (0)