Skip to content

Commit f290aed

Browse files
committed
Fix Reader UI tests for the subscriptions feed
1 parent 50364fc commit f290aed

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

API-Mocks/WordPressMocks/src/main/assets/mocks/__files/__admin/scenarios.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"state" : "Started",
1313
"possibleStates" : [ "Started", "initial_likes_list", "post_liked", "new_likes_list" ]
1414
},
15+
{
16+
"id" : "reader_subscriptions_flow",
17+
"name" : "reader_subscriptions_flow",
18+
"state" : "Started",
19+
"possibleStates" : [ "Started", "initial_subscriptions_list", "empty_subscriptions_list" ]
20+
},
1521
{
1622
"id" : "new_page_flow",
1723
"name" : "new_page_flow",

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/reader/rest_v12_read_following.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"scenarioName": "reader_subscriptions_flow",
3+
"requiredScenarioState": "Started",
4+
"newScenarioState": "initial_subscriptions_list",
25
"request": {
36
"method": "GET",
47
"urlPath": "/rest/v1.2/read/following"
@@ -1478,4 +1481,4 @@
14781481
"Cache-Control": "no-cache, must-revalidate, max-age=0"
14791482
}
14801483
}
1481-
}
1484+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"scenarioName": "reader_subscriptions_flow",
3+
"requiredScenarioState": "initial_subscriptions_list",
4+
"newScenarioState": "empty_subscriptions_list",
5+
"request": {
6+
"method": "GET",
7+
"urlPath": "/rest/v1.2/read/following"
8+
},
9+
"response": {
10+
"status": 200,
11+
"jsonBody": {
12+
"date_range": {
13+
"before": "2019-05-23T13:00:09+00:00",
14+
"after": "2021-05-17T16:34:44+00:00"
15+
},
16+
"number": 0,
17+
"posts": [
18+
]
19+
},
20+
"headers": {
21+
"Content-Type": "application/json",
22+
"Connection": "keep-alive",
23+
"Cache-Control": "no-cache, must-revalidate, max-age=0"
24+
}
25+
}
26+
}

WordPress/UITests/Tests/ReaderTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class ReaderTests: XCTestCase {
66
@MainActor
77
override func setUp() async throws {
88
setUpTestSuite()
9+
try await WireMock.setUpScenario(scenario: "reader_subscriptions_flow")
910
try await WireMock.setUpScenario(scenario: "reader_like_post_flow")
1011

1112
try LoginFlow

0 commit comments

Comments
 (0)