Skip to content

Commit b3ccfe7

Browse files
committed
fixup! fix: refactor group_configuration_spec to not call AjaxHelpers inside it()
1 parent 21bf561 commit b3ccfe7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

cms/static/js/spec/views/group_configuration_spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ define([
2727
// spec files that set up window.course in their own beforeEach.
2828
describe('Group Configurations', function() {
2929

30+
// Pre-populate the jasmine-fixtures cache for every template used in the inner
31+
// beforeEach blocks below. The outer beforeEach installs sinon.useFakeXMLHttpRequest(),
32+
// which intercepts the synchronous XHR that readFixtures() uses to load .underscore
33+
// files from the Karma server. Calling readFixtures() here — at describe-body level,
34+
// before any beforeEach runs — loads the files over real XHR and caches the results.
35+
// Subsequent readFixtures() calls inside beforeEach then return from cache without
36+
// making a new (intercepted) request.
37+
readFixtures(
38+
'group-configuration-details.underscore',
39+
'group-configuration-editor.underscore',
40+
'group-edit.underscore',
41+
'list.underscore',
42+
'content-group-editor.underscore',
43+
'partition-group-details.underscore'
44+
);
45+
3046
var requests, xhrFactory;
3147
var SELECTORS = {
3248
detailsView: '.group-configuration-details',

0 commit comments

Comments
 (0)