diff options
Diffstat (limited to 'server/tests/api/check-params/follows.ts')
-rw-r--r-- | server/tests/api/check-params/follows.ts | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/server/tests/api/check-params/follows.ts b/server/tests/api/check-params/follows.ts index 2eb54cb0a..488666a75 100644 --- a/server/tests/api/check-params/follows.ts +++ b/server/tests/api/check-params/follows.ts | |||
@@ -6,7 +6,7 @@ import { | |||
6 | cleanupTests, | 6 | cleanupTests, |
7 | createUser, | 7 | createUser, |
8 | flushAndRunServer, | 8 | flushAndRunServer, |
9 | makeDeleteRequest, | 9 | makeDeleteRequest, makeGetRequest, |
10 | makePostBodyRequest, | 10 | makePostBodyRequest, |
11 | ServerInfo, | 11 | ServerInfo, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
@@ -131,6 +131,27 @@ describe('Test server follows API validators', function () { | |||
131 | it('Should fail with an incorrect sort', async function () { | 131 | it('Should fail with an incorrect sort', async function () { |
132 | await checkBadSortPagination(server.url, path) | 132 | await checkBadSortPagination(server.url, path) |
133 | }) | 133 | }) |
134 | |||
135 | it('Should fail with an incorrect state', async function () { | ||
136 | await makeGetRequest({ | ||
137 | url: server.url, | ||
138 | path, | ||
139 | query: { | ||
140 | state: 'blabla' | ||
141 | } | ||
142 | }) | ||
143 | }) | ||
144 | |||
145 | it('Should fail succeed with the correct params', async function () { | ||
146 | await makeGetRequest({ | ||
147 | url: server.url, | ||
148 | path, | ||
149 | statusCodeExpected: 200, | ||
150 | query: { | ||
151 | state: 'accepted' | ||
152 | } | ||
153 | }) | ||
154 | }) | ||
134 | }) | 155 | }) |
135 | 156 | ||
136 | describe('When listing followers', function () { | 157 | describe('When listing followers', function () { |
@@ -147,6 +168,27 @@ describe('Test server follows API validators', function () { | |||
147 | it('Should fail with an incorrect sort', async function () { | 168 | it('Should fail with an incorrect sort', async function () { |
148 | await checkBadSortPagination(server.url, path) | 169 | await checkBadSortPagination(server.url, path) |
149 | }) | 170 | }) |
171 | |||
172 | it('Should fail with an incorrect state', async function () { | ||
173 | await makeGetRequest({ | ||
174 | url: server.url, | ||
175 | path, | ||
176 | query: { | ||
177 | state: 'blabla' | ||
178 | } | ||
179 | }) | ||
180 | }) | ||
181 | |||
182 | it('Should fail succeed with the correct params', async function () { | ||
183 | await makeGetRequest({ | ||
184 | url: server.url, | ||
185 | path, | ||
186 | statusCodeExpected: 200, | ||
187 | query: { | ||
188 | state: 'accepted' | ||
189 | } | ||
190 | }) | ||
191 | }) | ||
150 | }) | 192 | }) |
151 | 193 | ||
152 | describe('When removing a follower', function () { | 194 | describe('When removing a follower', function () { |