File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/compass-global-writes/src/components/states Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { expect } from 'chai' ;
3+ import { screen , userEvent } from '@mongodb-js/testing-library-compass' ;
4+ import { LoadingError } from './loading-error' ;
5+ import { renderWithStore } from '../../../tests/create-store' ;
6+ import Sinon from 'sinon' ;
7+
8+ const error = 'Test failure' ;
9+
10+ function renderWithProps (
11+ props ?: Partial < React . ComponentProps < typeof LoadingError > >
12+ ) {
13+ return renderWithStore ( < LoadingError error = { error } { ...props } /> ) ;
14+ }
15+
16+ describe ( 'LoadingError' , function ( ) {
17+ it ( 'renders the error' , async function ( ) {
18+ await renderWithProps ( ) ;
19+ expect ( screen . getByText ( error ) ) . to . exist ;
20+ } ) ;
21+ } ) ;
You can’t perform that action at this time.
0 commit comments