Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions tests/System/support/commands/db.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -631,38 +631,16 @@ Cypress.Commands.add('db_getUserId', () => {
* @returns integer
*/
Cypress.Commands.add('db_setInvalidTufRoot', () => {
cy.task('queryDB', 'DELETE FROM #__tuf_metadata WHERE id = 1');
cy.task('queryDB', 'DELETE FROM #__updates WHERE update_site_id = 1');
cy.task('queryDB', createInsertQuery(
'tuf_metadata',
{
id: 1,
update_site_id: 1,
root: JSON.stringify(invalidTufMetadata.root),
targets: '',
snapshot: '',
timestamp: '',
},
));
cy.task('queryDB', `UPDATE #__tuf_metadata SET root = '${JSON.stringify(invalidTufMetadata.root)}', targets = '', snapshot = '', timestamp = '' WHERE id = 1`);
});

/**
* Inserts an invalid tuf metadata set
* Inserts a valid tuf metadata set
*
* @returns integer
*/
Cypress.Commands.add('db_setValidTufRoot', () => {
cy.task('queryDB', 'DELETE FROM #__tuf_metadata WHERE id = 1');
cy.task('queryDB', 'DELETE FROM #__updates WHERE update_site_id = 1');
cy.task('queryDB', createInsertQuery(
'tuf_metadata',
{
id: 1,
update_site_id: 1,
root: JSON.stringify(validTufMetadata.root),
targets: '',
snapshot: '',
timestamp: '',
},
));
cy.task('queryDB', `UPDATE #__tuf_metadata SET root = '${JSON.stringify(validTufMetadata.root)}', targets = '', snapshot = '', timestamp = '' WHERE id = 1`);
});