Skip to content

Commit 6fca8ff

Browse files
committed
wip: still working on this request refactor
1 parent 9768a36 commit 6fca8ff

File tree

1 file changed

+54
-60
lines changed

1 file changed

+54
-60
lines changed

cypress/e2e/request.cy.js

Lines changed: 54 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -67,76 +67,70 @@ describe('Viewing one request', () => {
6767
})
6868
})
6969

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+
})
7076

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+
})
11381
})
114-
})
115-
})
11682

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', () => {})
12598
})
12699

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+
})
130112
})
113+
114+
it('displays the documents', () => {})
131115
})
132116

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+
})
136129
})
130+
131+
it('displays the files', () => {})
137132
})
138-
// TODO: add tests to confirm that messages, files, additional info, document sections all show correctly.
139133
})
140134
})
141135
})
142-
})
136+
})

0 commit comments

Comments
 (0)