File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed
packages/compass-indexes/src/components/create-index-modal Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { render , screen } from '@mongodb-js/testing-library-compass' ;
3+ import CreateIndexModalHeader from './create-index-modal-header' ;
4+ import { expect } from 'chai' ;
5+
6+ describe ( 'CreateIndexModalHeader' , ( ) => {
7+ it ( 'renders the modal title' , ( ) => {
8+ render ( < CreateIndexModalHeader /> ) ;
9+ const title = screen . getByTestId ( 'create-index-modal-header-title' ) ;
10+
11+ expect ( title . textContent ) . to . be . equal ( 'Create Index' ) ;
12+ } ) ;
13+
14+ it ( 'renders the subtitle text' , ( ) => {
15+ render ( < CreateIndexModalHeader /> ) ;
16+ const subtitle = screen . getByTestId ( 'create-index-modal-header-subtitle' ) ;
17+ expect ( subtitle ) . to . exist ;
18+ } ) ;
19+
20+ it ( 'renders the link to the Index Strategies Documentation' , ( ) => {
21+ render ( < CreateIndexModalHeader /> ) ;
22+ const link = screen . getByRole ( 'link' , {
23+ name : / I n d e x S t r a t e g i e s D o c u m e n t a t i o n / i,
24+ } ) ;
25+ expect ( link ) . to . exist ;
26+ } ) ;
27+ } ) ;
Original file line number Diff line number Diff line change @@ -17,11 +17,12 @@ const headerStyle = css({
1717const CreateIndexModalHeader = ( ) => {
1818 return (
1919 < div className = { cx ( headerStyle ) } >
20- < H3 data-testid = "modal-title" id = "modal-title" >
21- Create Index
22- </ H3 >
20+ < H3 data-testid = "create-index-modal-header-title" > Create Index</ H3 >
2321
24- < Body style = { { color : palette . gray . dark1 } } >
22+ < Body
23+ data-testid = "create-index-modal-header-subtitle"
24+ style = { { color : palette . gray . dark1 } }
25+ >
2526 The best indexes for your application should consider a number of
2627 factors, such as your data model, and the queries you use most often. To
2728 learn more about indexing best practices, read the{ ' ' }
Original file line number Diff line number Diff line change 55 ModalFooter ,
66 ModalHeader ,
77 ModalBody ,
8- Link ,
9- palette ,
108} from '@mongodb-js/compass-components' ;
119import {
1210 fieldAdded ,
You can’t perform that action at this time.
0 commit comments