Skip to content

Commit a21dc49

Browse files
mattwr18joaopapereira
authored andcommitted
Fix bug not stubbing event info request
1 parent 66d11fd commit a21dc49

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"id": 1,
3+
"name": "NewEvent",
4+
"category": "PairProgramming",
5+
"description": "",
6+
"repeats": "never",
7+
"repeats_every_n_weeks": null,
8+
"repeats_weekly_each_days_of_the_week_mask": 0,
9+
"repeat_ends": false,
10+
"repeat_ends_on": null,
11+
"time_zone": "UTC",
12+
"created_at": "2025-01-05T13:02:16.681Z",
13+
"updated_at": null,
14+
"url": null,
15+
"slug": "newevent",
16+
"start_datetime": "2025-01-05T00:00:00.000Z",
17+
"duration": 30,
18+
"exclusions": [],
19+
"project_id": null,
20+
"creator_id": 3493,
21+
"for": "All",
22+
"modifier_id": null,
23+
"creator_attendance": null,
24+
"time": "2019-02-24T00:00:00.000Z",
25+
"creator": "Mad Writer",
26+
"modifier": "Mad Writer",
27+
"creatorGravatarUrl": "https://www.gravatar.com/avatar/9249736dae1898d537770886061c06f9?s=32&d=retro",
28+
"modifierGravatarUrl": "https://www.gravatar.com/avatar/9249736dae1898d537770886061c06f9?s=32&d=retro",
29+
"videos": [],
30+
"createdAt": "2018-03-12T16:30:55.399Z",
31+
"updatedAt": "2018-03-12T16:30:55.399Z"
32+
}

cypress/integration/common/web_steps.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,18 @@ Then('I should be able to create a new event quickly', () => {
220220
cy.wait('@newlyCreatedEvent')
221221
})
222222

223-
Then("I should be on the newly created event's page", () => {
223+
When("I should be redirected to the event's info page", () => {
224+
cy.fixture('newlyCreatedEventInfo').then(newlyCreatedEventInfo => {
225+
cy.route(/\/api\/v1\/events\/newevent/, newlyCreatedEventInfo).as('getEvent')
226+
cy.visit('/events/newevent')
227+
cy.window()
228+
.its('store')
229+
.invoke('dispatch', { type: 'GET_EVENT_INFO', payload: newlyCreatedEventInfo })
230+
})
231+
cy.wait('@getEvent')
232+
})
233+
234+
Then("I should see the newly created event's info", () => {
224235
cy.url().should('include', 'events/newevent')
225236
.get('h2')
226237
.should('contain', 'NewEvent')
@@ -230,7 +241,7 @@ Then("I should be on the newly created event's page", () => {
230241
.should('contain', 'Event for: All')
231242
.get('img.ui.circular.image')
232243
.should('have.attr', 'src')
233-
.and('contain', 'https://www.gravatar.com/avatar/ad5b3d2d4c25801fcb632cf8014fb555?s=80&d=retro')
244+
.and('contain', 'https://www.gravatar.com/avatar/9249736dae1898d537770886061c06f9?s=32&d=retro')
234245
.get('p')
235246
.should('contain', 'created by:')
236247
})

cypress/integration/create_events.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Feature: Create new event
55
Scenario: Quick create
66
Given I am logged in
77
Then I should be able to create a new event quickly
8-
And I should be on the newly created event's page
8+
And I should be redirected to the event's info page
9+
And I should see the newly created event's info

0 commit comments

Comments
 (0)