File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,20 @@ describe('<Sketchlist />', () => {
79
79
expect ( screen . queryByText ( 'Delete' ) ) . toBeInTheDocument ( ) ;
80
80
} ) ;
81
81
82
- it ( 'snapshot testing' , ( ) => {
83
- const { asFragment } = subject ( ) ;
84
- expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
82
+ it ( 'renders component correctly' , ( ) => {
83
+ const { container } = subject ( ) ;
84
+
85
+ expect ( container . querySelector ( '.sketches-table-container' ) ) . toBeInTheDocument ( ) ;
86
+ expect ( container . querySelector ( '.sketches-table' ) ) . toBeInTheDocument ( ) ;
87
+ expect ( container . querySelector ( 'thead' ) ) . toBeInTheDocument ( ) ;
88
+ expect ( container . querySelector ( 'tbody' ) ) . toBeInTheDocument ( ) ;
89
+
90
+ // expect(screen.getByText(/Sketch/i)).toBeInTheDocument();
91
+ // expect(screen.getByText(/Date created/i)).toBeInTheDocument();
92
+ // expect(screen.getByText(/Last updated/i)).toBeInTheDocument();
93
+
94
+ const sketchRows = container . querySelectorAll ( 'tbody tr' ) ;
95
+ expect ( sketchRows . length ) . toBeGreaterThan ( 0 ) ;
85
96
} ) ;
86
97
87
98
describe ( 'different user than the one who created the sketches' , ( ) => {
@@ -113,4 +124,4 @@ describe('<Sketchlist />', () => {
113
124
expect ( screen . queryByText ( 'Delete' ) ) . not . toBeInTheDocument ( ) ;
114
125
} ) ;
115
126
} ) ;
116
- } ) ;
127
+ } ) ;
Original file line number Diff line number Diff line change @@ -8,15 +8,17 @@ const mockProjects = [
8
8
updatedAt : '2021-02-26T04:58:29' ,
9
9
files : [ ] ,
10
10
createdAt : '2021-02-26T04:58:14' ,
11
- id : 'testid1'
11
+ id : 'testid1' ,
12
+ visibility : 'Public'
12
13
} ,
13
14
{
14
15
name : 'testsketch2' ,
15
16
_id : 'testid2' ,
16
17
updatedAt : '2021-02-23T17:40:43' ,
17
18
files : [ ] ,
18
19
createdAt : '2021-02-23T17:40:43' ,
19
- id : 'testid2'
20
+ id : 'testid2' ,
21
+ visibility : 'Public'
20
22
}
21
23
] ;
22
24
You can’t perform that action at this time.
0 commit comments