Feat v0.7.1 surface runner framework (#55)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #55.
This commit is contained in:
@@ -17,11 +17,11 @@
|
||||
T.provisionFixtures = async function () {
|
||||
var fixtures = T.fixtures;
|
||||
if (fixtures.ready) {
|
||||
if (typeof UI !== 'undefined') UI.toast('Fixtures already provisioned — tear down first', 'warning');
|
||||
console.log('[ICD] Fixtures already provisioned — tear down first');
|
||||
return;
|
||||
}
|
||||
if (T.user.role !== 'admin') {
|
||||
if (typeof UI !== 'undefined') UI.toast('Admin required to provision fixtures', 'error');
|
||||
console.log('[ICD] Admin required to provision fixtures');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,13 +72,11 @@
|
||||
} catch (e) { errors.push('Group: ' + e.message); }
|
||||
|
||||
fixtures.ready = true;
|
||||
if (typeof T.renderFixtures === 'function') T.renderFixtures();
|
||||
|
||||
if (errors.length > 0) {
|
||||
if (typeof UI !== 'undefined') UI.toast('Fixtures created with ' + errors.length + ' errors', 'warning');
|
||||
console.warn('Fixture errors:', errors);
|
||||
console.warn('[ICD] Fixtures created with ' + errors.length + ' errors', errors);
|
||||
} else {
|
||||
if (typeof UI !== 'undefined') UI.toast('Fixtures provisioned (' + fixtures.users.length + ' users, team, group)', 'success');
|
||||
console.log('[ICD] Fixtures provisioned (' + fixtures.users.length + ' users, team, group)');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -91,8 +89,7 @@
|
||||
try { await T.safeDelete('/admin/users/' + fixtures.users[i].id); } catch (e) { /* ok */ }
|
||||
}
|
||||
T.fixtures = { ready: false, users: [], team: null, group: null };
|
||||
if (typeof T.renderFixtures === 'function') T.renderFixtures();
|
||||
if (typeof UI !== 'undefined') UI.toast('Test fixtures torn down', 'info');
|
||||
console.log('[ICD] Test fixtures torn down');
|
||||
};
|
||||
|
||||
T.getFixtureUser = function (suffix) {
|
||||
|
||||
Reference in New Issue
Block a user