Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/api_spec.js')
-rw-r--r--spec/frontend/api_spec.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index 75faf6d66fa..bc3e12d3fc4 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -1619,6 +1619,28 @@ describe('Api', () => {
});
});
+ describe('projectSecureFiles', () => {
+ it('fetches secure files for a project', async () => {
+ const projectId = 1;
+ const secureFiles = [
+ {
+ id: projectId,
+ title: 'File Name',
+ permissions: 'read_only',
+ checksum: '12345',
+ checksum_algorithm: 'sha256',
+ created_at: '2022-02-21T15:27:18',
+ },
+ ];
+
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/secure_files`;
+ mock.onGet(expectedUrl).reply(httpStatus.OK, secureFiles);
+ const { data } = await Api.projectSecureFiles(projectId, {});
+
+ expect(data).toEqual(secureFiles);
+ });
+ });
+
describe('Feature Flag User List', () => {
let expectedUrl;
let projectId;