mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
test: Migrate NDV tests from Cypress -> Playwright (#19148)
This commit is contained in:
42
packages/testing/playwright/fixtures/Dummy_javascript.txt
Normal file
42
packages/testing/playwright/fixtures/Dummy_javascript.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
var File = function(url, object){
|
||||
File.list = Array.isArray(File.list)? File.list : [];
|
||||
File.progress = File.progress || 0;
|
||||
this.progress = 0;
|
||||
this.object = object;
|
||||
this.url = url;
|
||||
};
|
||||
|
||||
File.indexOf = function(term){
|
||||
for(var index in File.list){
|
||||
var file = File.list[index];
|
||||
if (file.equals(term) || file.url === term || file.object === term) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
File.find = function(term){
|
||||
var index = File.indexOf(term);
|
||||
return ~index && File.list[index];
|
||||
};
|
||||
|
||||
File.prototype.equals = function(file){
|
||||
var isFileType = file instanceof File;
|
||||
return isFileType && this.url === file.url && this.object === file.object;
|
||||
};
|
||||
|
||||
File.prototype.save = function(update){
|
||||
update = typeof update === 'undefined'? true : update;
|
||||
if(Array.isArray(File.list)){
|
||||
var index = File.indexOf(this);
|
||||
if(~index && update) {
|
||||
File.list[index] = this;
|
||||
console.warn('File `%s` has been loaded before and updated now for: %O.', this.url, this);
|
||||
}else File.list.push(this);
|
||||
console.log(File.list)
|
||||
}else{
|
||||
File.list = [this];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
Reference in New Issue
Block a user