From 7f6b1cfb9703af0ab48700cf2552e0da7f2aebb7 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 25 Feb 2022 19:52:45 +0000 Subject: [PATCH] Add ability to extract creator Account from TestTemplate --- lib/TestTemplate.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/TestTemplate.js b/lib/TestTemplate.js index e2e32e7..023fd6e 100644 --- a/lib/TestTemplate.js +++ b/lib/TestTemplate.js @@ -19,6 +19,12 @@ class TestTemplate { */ accountId; + /** + * The account that created it + * @type {Account} + */ + account; + /** * The name of the test template * @type {string} @@ -59,10 +65,16 @@ class TestTemplate { for (const [ k, v ] of Object.entries(record[0])) this[k] = v; + this.account = await this.getAccount(); + return this; })(); } + async getAccount() { + return new (require('./Account'))(this.accountId); + } + assignClass() { }