Add frontend fixture for `all_releases_query.graphql`
What does this MR do?
Adds a frontend fixture that represents the response of app/assets/javascripts/releases/queries/all_releases.query.graphql.
Context
This is the first frontend fixture generated from a GraphQL query; all our existing (JSON) frontend fixtures are generated from our REST API. Because of this, there are no conventions to follow with regards to file structure or naming.
A future MR will update all release tests to use this fixture instead of the hard-coded GraphQL response in mock_data.js.
The fixture
This new fixture is written to tmp/tests/frontend/fixtures-ee/graphql/releases/queries/all_releases.query.graphql.json and looks like this:
{
"data": {
"project": {
"releases": {
"nodes": [
{
"name": "The first release",
"tagName": "v1.1",
"tagPath": "/namespace1/releases-project/-/tags/v1.1",
"descriptionHtml": "\u003cp data-sourcepos=\"1:1-1:33\" dir=\"auto\"\u003eBest. Release. \u003cstrong\u003eEver.\u003c/strong\u003e \u003cgl-emoji title=\"rocket\" data-name=\"rocket\" data-unicode-version=\"6.0\"\u003e🚀\u003c/gl-emoji\u003e\u003c/p\u003e",
"releasedAt": "2018-12-10T00:00:00Z",
"upcomingRelease": true,
"assets": {
"count": 6,
"sources": {
"nodes": [
{
"format": "zip",
"url": "http://localhost/namespace1/releases-project/-/archive/v1.1/releases-project-v1.1.zip"
},
{
"format": "tar.gz",
"url": "http://localhost/namespace1/releases-project/-/archive/v1.1/releases-project-v1.1.tar.gz"
},
{
"format": "tar.bz2",
"url": "http://localhost/namespace1/releases-project/-/archive/v1.1/releases-project-v1.1.tar.bz2"
},
{
"format": "tar",
"url": "http://localhost/namespace1/releases-project/-/archive/v1.1/releases-project-v1.1.tar"
}
]
},
"links": {
"nodes": [
{
"id": "gid://gitlab/Releases::Link/2",
"name": "Runbook",
"url": "https://example.com/runbook",
"directAssetUrl": "http://localhost/namespace1/releases-project/-/releases/v1.1/binaries/awesome-app-1",
"linkType": "RUNBOOK",
"external": true
},
{
"id": "gid://gitlab/Releases::Link/1",
"name": "linux-amd64 binaries",
"url": "https://downloads.example.com/bin/gitlab-linux-amd64",
"directAssetUrl": "http://localhost/namespace1/releases-project/-/releases/v1.1/binaries/linux-amd64",
"linkType": "OTHER",
"external": true
}
]
}
},
"evidences": {
"nodes": [
{
"filepath": "http://localhost/namespace1/releases-project/-/releases/v1.1/evidences/1.json",
"collectedAt": "2020-09-24T02:25:21Z",
"sha": "760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d"
}
]
},
"links": {
"editUrl": "http://localhost/namespace1/releases-project/-/releases/v1.1/edit",
"issuesUrl": "http://localhost/namespace1/releases-project/-/issues?release_tag=v1.1\u0026scope=all\u0026state=opened",
"mergeRequestsUrl": "http://localhost/namespace1/releases-project/-/merge_requests?release_tag=v1.1\u0026scope=all\u0026state=opened",
"selfUrl": "http://localhost/namespace1/releases-project/-/releases/v1.1"
},
"commit": {
"sha": "b83d6e391c22777fca1ed3012fce84f633d7fed0",
"webUrl": "http://localhost/namespace1/releases-project/-/commit/b83d6e391c22777fca1ed3012fce84f633d7fed0",
"title": "Merge branch 'branch-merged' into 'master'"
},
"author": {
"webUrl": "http://localhost/user3",
"avatarUrl": "https://www.gravatar.com/avatar/2c75f98f3ea6cd6ee75cfbdfbb031388?s=80\u0026d=identicon",
"username": "user3"
},
"milestones": {
"nodes": [
{
"id": "gid://gitlab/Milestone/2",
"title": "12.4",
"description": null,
"webPath": "/namespace1/releases-project/-/milestones/2",
"stats": {
"totalIssuesCount": 4,
"closedIssuesCount": 1
}
},
{
"id": "gid://gitlab/Milestone/1",
"title": "12.3",
"description": null,
"webPath": "/namespace1/releases-project/-/milestones/1",
"stats": {
"totalIssuesCount": 5,
"closedIssuesCount": 3
}
}
]
}
}
],
"pageInfo": {
"startCursor": "eyJpZCI6IjEiLCJyZWxlYXNlZF9hdCI6IjIwMTgtMTItMTAgMDA6MDA6MDAuMDAwMDAwMDAwIFVUQyJ9",
"hasPreviousPage": false,
"hasNextPage": false,
"endCursor": "eyJpZCI6IjEiLCJyZWxlYXNlZF9hdCI6IjIwMTgtMTItMTAgMDA6MDA6MDAuMDAwMDAwMDAwIFVUQyJ9"
}
}
}
}
}
Edited by Nathan Friend