Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9336875
D6125.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D6125.id.diff
View Options
diff --git a/cypress/integration/vault.spec.js b/cypress/integration/vault.spec.js
--- a/cypress/integration/vault.spec.js
+++ b/cypress/integration/vault.spec.js
@@ -5,8 +5,6 @@
* See top-level LICENSE file for more information
*/
-const vaultItems = [];
-
const progressbarColors = {
'new': 'rgba(128, 128, 128, 0.5)',
'pending': 'rgba(0, 0, 255, 0.5)',
@@ -82,18 +80,22 @@
const release = this.origin[1].release;
this.releaseUrl = this.Urls.browse_release(release.id) + `?origin_url=${this.origin[1].url}`;
this.vaultReleaseDirectoryUrl = this.Urls.api_1_vault_cook_directory(release.directory);
-
- vaultItems[0] = {
- 'object_type': 'revision',
- 'object_id': this.revision,
- 'email': '',
- 'status': 'done',
- 'fetch_url': `/api/1/vault/revision/${this.revision}/gitfast/raw/`,
- 'progress_message': null
- };
});
beforeEach(function() {
+ // For some reason, this gets reset if we define it in the before() hook,
+ // so we need to define it here
+ this.vaultItems = [
+ {
+ 'object_type': 'revision',
+ 'object_id': this.revision,
+ 'email': '',
+ 'status': 'done',
+ 'fetch_url': `/api/1/vault/revision/${this.revision}/gitfast/raw/`,
+ 'progress_message': null
+ }
+ ];
+
this.genVaultDirCookingResponse = (status, message = null) => {
return genVaultCookingResponse('directory', this.directory, status,
message, this.vaultFetchDirectoryUrl);
@@ -366,7 +368,7 @@
it('should offer to recook an archive if no more available to download', function() {
- updateVaultItemList(this.Urls.browse_vault(), vaultItems);
+ updateVaultItemList(this.Urls.browse_vault(), this.vaultItems);
// Send 404 when fetching vault item
cy.intercept({url: this.vaultFetchRevisionUrl}, {
@@ -406,7 +408,7 @@
it('should remove selected vault items', function() {
- updateVaultItemList(this.Urls.browse_vault(), vaultItems);
+ updateVaultItemList(this.Urls.browse_vault(), this.vaultItems);
cy.get(`#vault-task-${this.revision}`)
.find('input[type="checkbox"]')
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 3 2025, 7:47 AM (10 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3228774
Attached To
D6125: vault.spec.js: Remove vaultItems from global variables
Event Timeline
Log In to Comment