mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:59:28 +00:00
Add ability to extract creator Account from TestTemplate
This commit is contained in:
@@ -19,6 +19,12 @@ class TestTemplate {
|
|||||||
*/
|
*/
|
||||||
accountId;
|
accountId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The account that created it
|
||||||
|
* @type {Account}
|
||||||
|
*/
|
||||||
|
account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the test template
|
* The name of the test template
|
||||||
* @type {string}
|
* @type {string}
|
||||||
@@ -59,10 +65,16 @@ class TestTemplate {
|
|||||||
for (const [ k, v ] of Object.entries(record[0]))
|
for (const [ k, v ] of Object.entries(record[0]))
|
||||||
this[k] = v;
|
this[k] = v;
|
||||||
|
|
||||||
|
this.account = await this.getAccount();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getAccount() {
|
||||||
|
return new (require('./Account'))(this.accountId);
|
||||||
|
}
|
||||||
|
|
||||||
assignClass() {
|
assignClass() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user