Fix saving showing archived setting
This commit is contained in:
parent
0f42ed3cf7
commit
4a3b4982ab
4 changed files with 51 additions and 8 deletions
|
|
@ -21,7 +21,7 @@ export class Factory {
|
|||
* @param override
|
||||
* @returns {[]}
|
||||
*/
|
||||
static create(count = 1, override = {}) {
|
||||
static create(count = 1, override = {}, truncate = true) {
|
||||
const data = []
|
||||
|
||||
for (let i = 1; i <= count; i++) {
|
||||
|
|
@ -38,7 +38,7 @@ export class Factory {
|
|||
data.push(entry)
|
||||
}
|
||||
|
||||
seed(this.table, data)
|
||||
seed(this.table, data, truncate)
|
||||
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
* @param table
|
||||
* @param data
|
||||
*/
|
||||
export function seed(table, data = {}) {
|
||||
if(data === null) {
|
||||
export function seed(table, data = {}, truncate = true) {
|
||||
if (data === null) {
|
||||
data = []
|
||||
}
|
||||
|
||||
cy.request({
|
||||
method: 'PATCH',
|
||||
url: `${Cypress.env('API_URL')}/test/${table}`,
|
||||
url: `${Cypress.env('API_URL')}/test/${table}?truncate=${truncate ? 'true' : 'false'}`,
|
||||
headers: {
|
||||
'Authorization': Cypress.env('TEST_SECRET'),
|
||||
},
|
||||
|
|
|
|||
Reference in a new issue