Skip to content

Commit

Permalink
e2e: fix version in fixture-backup
Browse files Browse the repository at this point in the history
  • Loading branch information
mayrmartin committed Apr 28, 2022
1 parent 324beff commit 7d419fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions blockchain/check-backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,21 @@ stream.on("finish", async () => {
const isValidMetadataFile = config.DirectoryHash === hash;

//Check for major version compatibility
const compatibleVersions =
const inCompatibleVersions =
config.hasOwnProperty("Version") &&
config.Version.split(".")[0] === version.split(".")[0];

if (isValidMetadataFile) {
console.log("The provided backup file is valid\n");
console.log("No updated backup is created");
process.exit(0);
} else if (compatibleVersions) {
process.exit(1);
} else if (inCompatibleVersions) {
console.log("The provided backup is from a prior major version.\n");
console.log(
"Use the migration guide to restore the backup. More information can be found on GitHub.\n",
);
console.log("No updated backup is created");
process.exit(1);
} else {
console.log("The provided backup file is invalid\n");
}
Expand Down
Binary file modified e2e-test/cypress/fixtures/backup_orga_test.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion e2e-test/cypress/integration/backup_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe("Backup Feature", function() {
expect(success).to.eq(true);
});
cy.get("[data-test=client-snackbar]")
.contains("Not a valid TruBudget backup")
.contains("failed to restore backup: Backup with these configurations is not permitted")
.should("be.visible");
cy.url()
.should("include", "/projects")
Expand Down

0 comments on commit 7d419fe

Please sign in to comment.