()
| 1317 | } |
| 1318 | |
| 1319 | getTestStudentId () { |
| 1320 | const testStudentRelation = (this.get('related') || []).filter(related => related.relation === 'TestStudent')[0] |
| 1321 | if (testStudentRelation) { |
| 1322 | return Promise.resolve({ id: testStudentRelation.userId, new: false }) |
| 1323 | } else { |
| 1324 | return new Promise((resolve, reject) => { |
| 1325 | try { |
| 1326 | this.createTestStudentAccount().then(response => { |
| 1327 | resolve({ id: response.relatedUserId, new: true }) |
| 1328 | }) |
| 1329 | } catch (e) { |
| 1330 | reject(e) |
| 1331 | } |
| 1332 | }) |
| 1333 | } |
| 1334 | } |
| 1335 | |
| 1336 | switchToStudentMode () { |
| 1337 | return this.getTestStudentId().then(({ id }) => this.spy({ id })) |
no test coverage detected