@@ -67,76 +67,70 @@ describe('Viewing one request', () => {
67
67
} )
68
68
} )
69
69
70
+ describe ( 'which when returns request data' , ( ) => {
71
+ it . only ( 'shows the request stats section' , ( ) => {
72
+ cy . get ( 'div.request-stats-card' ) . should ( 'exist' ) . then ( ( ) => {
73
+ cy . log ( 'Request stats section renders successfully.' )
74
+ } )
75
+ } )
70
76
71
- cy . customApiIntercept ( {
72
- action : 'GET' ,
73
- alias : 'useAllSOWs' ,
74
- requestURL : `/quote_groups/${ uuid } /proposals.json` ,
75
- data : proposals ,
76
- dataFixture : 'one-request/proposals.json' ,
77
- emptyDataFixture : 'empty.json' ,
78
- loading,
79
- error
80
- } )
81
-
82
- cy . customApiIntercept ( {
83
- action : 'GET' ,
84
- alias : 'useAllMessages' ,
85
- requestURL : `/quote_groups/${ uuid } /messages.json` ,
86
- data : messages ,
87
- dataFixture : 'one-request/messages.json' ,
88
- emptyDataFixture : 'empty.json' ,
89
- loading,
90
- error
91
- } )
92
-
93
- cy . customApiIntercept ( {
94
- action : 'GET' ,
95
- alias : 'useAllFiles' ,
96
- requestURL : `/quote_groups/${ uuid } /notes.json` ,
97
- data : files ,
98
- dataFixture : 'one-request/notes.json' ,
99
- emptyDataFixture : 'empty.json' ,
100
- loading,
101
- error
102
- } )
103
- cy . visit ( `/requests/${ uuid } ` )
104
- } )
105
-
106
- context ( 'request is loading' , ( ) => {
107
- before ( ( ) => {
108
- loading = true
109
- } )
110
- it ( 'should show a loading spinner.' , ( ) => {
111
- cy . get ( "[aria-label='tail-spin-loading']" ) . should ( 'be.visible' ) . then ( ( ) => {
112
- cy . log ( 'Loading spinner displays correctly.' )
77
+ it ( 'shows the status bar' , ( ) => {
78
+ cy . get ( "div[data-cy='status-bar']" ) . should ( 'exist' ) . then ( ( ) => {
79
+ cy . log ( 'Status bar renders successfully.' )
80
+ } )
113
81
} )
114
- } )
115
- } )
116
82
117
- describe ( 'request page components are loading successfully, &' , ( ) => {
118
- context ( 'the request page' , ( ) => {
119
- before ( ( ) => {
120
- loading =
121
- request = true
122
- proposals = true
123
- messages = true
124
- files = true
83
+ context ( 'with messages' , ( ) => {
84
+ before ( ( ) => {
85
+ cy . customApiIntercept ( {
86
+ action : 'GET' ,
87
+ alias : 'useAllMessages' ,
88
+ requestURL : `/quote_groups/${ uuid } /messages.json` ,
89
+ data : messages ,
90
+ dataFixture : 'one-request/messages.json' ,
91
+ emptyDataFixture : 'empty.json' ,
92
+ loading,
93
+ error
94
+ } )
95
+ } )
96
+
97
+ it ( 'displays the messages' , ( ) => { } )
125
98
} )
126
99
127
- it ( "should show the request stats section." , ( ) => {
128
- cy . get ( 'div.request-stats-card' ) . should ( 'exist' ) . then ( ( ) => {
129
- cy . log ( 'Request stats section renders successfully.' )
100
+ context ( 'with documents' , ( ) => {
101
+ before ( ( ) => {
102
+ cy . customApiIntercept ( {
103
+ action : 'GET' ,
104
+ alias : 'useAllSOWs' ,
105
+ requestURL : `/quote_groups/${ uuid } /proposals.json` ,
106
+ data : proposals ,
107
+ dataFixture : 'one-request/proposals.json' ,
108
+ emptyDataFixture : 'empty.json' ,
109
+ loading,
110
+ error
111
+ } )
130
112
} )
113
+
114
+ it ( 'displays the documents' , ( ) => { } )
131
115
} )
132
116
133
- it ( "should show the status bar." , ( ) => {
134
- cy . get ( "div[data-cy='status-bar']" ) . should ( 'exist' ) . then ( ( ) => {
135
- cy . log ( 'Status bar renders successfully.' )
117
+ context ( 'with files' , ( ) => {
118
+ before ( ( ) => {
119
+ cy . customApiIntercept ( {
120
+ action : 'GET' ,
121
+ alias : 'useAllFiles' ,
122
+ requestURL : `/quote_groups/${ uuid } /notes.json` ,
123
+ data : files ,
124
+ dataFixture : 'one-request/notes.json' ,
125
+ emptyDataFixture : 'empty.json' ,
126
+ loading,
127
+ error
128
+ } )
136
129
} )
130
+
131
+ it ( 'displays the files' , ( ) => { } )
137
132
} )
138
- // TODO: add tests to confirm that messages, files, additional info, document sections all show correctly.
139
133
} )
140
134
} )
141
135
} )
142
- } )
136
+ } )
0 commit comments