Revert "fix: all auto fixable eslint issues (#31900)" (#32203)

This reverts commit 228180b1ef.
This commit is contained in:
Syed Ali Abbas Zaidi
2023-05-09 13:53:54 +05:00
committed by GitHub
parent 228180b1ef
commit adf879e8b2
354 changed files with 1489 additions and 1498 deletions

View File

@@ -12,7 +12,7 @@ define(
doc.body.innerHTML = iframe_html;
var verify_no_modification = function(src) {
iframe_html = `<iframe width="618" height="350" src="${src}" frameborder="0" allowfullscreen></iframe>`;
iframe_html = '<iframe width="618" height="350" src="' + src + '" frameborder="0" allowfullscreen></iframe>';
doc.body.innerHTML = iframe_html;
IframeBinding.iframeBinding(doc);

View File

@@ -50,7 +50,7 @@ define(
return {
pass: passed,
message: `Expected ${actual}${passed ? '' : ' not'} to equal ${expected}`
message: 'Expected ' + actual + (passed ? '' : ' not') + ' to equal ' + expected
};
}
};
@@ -69,7 +69,7 @@ define(
return {
pass: passed,
message: `Expected ${actual}${passed ? '' : ' not'} to equal ${expected}`
message: 'Expected ' + actual + (passed ? '' : ' not') + ' to equal ' + expected
};
}
};

View File

@@ -181,7 +181,7 @@ define(
});
$.each(metadataDict, function(index, val) {
it(`toModels with argument as ${index}`, function() {
it('toModels with argument as ' + index, function() {
expect(transcripts.toModels(val)).toEqual(models);
});
});

View File

@@ -81,7 +81,7 @@ define(
var elList = ['$form', '$input', '$progress'],
validFileExtensions = ['srt', 'sjson'],
result = $.map(validFileExtensions, function(item, index) {
return `.${item}`;
return '.' + item;
}).join(', ');
view.validFileExtensions = validFileExtensions;
@@ -169,7 +169,7 @@ define(
};
$.each(data, function(fileType, fileInfo) {
it(`${fileType} file type`, function() {
it(fileType + ' file type', function() {
var result = view.checkExtValidity(fileInfo);
expect(result).toBe(fileInfo.isValid);
@@ -190,8 +190,8 @@ define(
spyOn($.fn, 'width').and.callThrough();
view.xhrProgressHandler(null, null, null, percent);
expect(view.$progress.width).toHaveBeenCalledWith(`${percent}%`);
expect(view.$progress.html()).toBe(`${percent}%`);
expect(view.$progress.width).toHaveBeenCalledWith(percent + '%');
expect(view.$progress.html()).toBe(percent + '%');
});
describe('xhrCompleteHandler', function() {

View File

@@ -104,7 +104,7 @@ define(
];
$.each(wrongArgumentLists, function(index, element) {
it(`${element.argName} argument(s) is/are absent`, function() {
it(element.argName + ' argument(s) is/are absent', function() {
var result = Utils.getField.apply(this, element.list);
expect(result).toBeUndefined();
@@ -221,7 +221,7 @@ define(
it('Method: getYoutubeLink', function() {
var videoId = 'video_id',
result = Utils.getYoutubeLink(videoId),
expectedResult = `http://youtu.be/${videoId}`;
expectedResult = 'http://youtu.be/' + videoId;
expect(result).toBe(expectedResult);
});
@@ -263,7 +263,7 @@ define(
describe('Wrong arguments ', function() {
it('youtube videoId is wrong', function() {
var videoId = 'wrong_id',
link = `http://youtu.be/${videoId}`,
link = 'http://youtu.be/' + videoId,
result = Utils.parseLink(link);
expect(result).toEqual({mode: 'incorrect'});

View File

@@ -65,7 +65,7 @@ define(
return {
pass: passed,
message: `Expected ${actual}${passed ? '' : ' not'} to equal ${expected}`
message: 'Expected ' + actual + (passed ? '' : ' not') + ' to equal ' + expected
};
}
};
@@ -83,7 +83,7 @@ define(
return {
pass: passed,
message: `Expected ${actual}${passed ? '' : ' not'} to equal ${expected}`
message: 'Expected ' + actual + (passed ? '' : ' not') + ' to equal ' + expected
};
}
};

View File

@@ -117,7 +117,7 @@ define(
});
makeUploadUrl = function(fileName) {
return `http://www.example.com/test_url/${fileName}`;
return 'http://www.example.com/test_url/' + fileName;
};
getSentRequests = function() {
@@ -222,7 +222,7 @@ define(
fileInfo
]
},
S3Url = `http://s3.aws.com/upload/videos/${fileInfo.name}`,
S3Url = 'http://s3.aws.com/upload/videos/' + fileInfo.name,
requests;
// this is required so that we can use AjaxHelpers ajax mock utils instead of jasmine mock-ajax.js
@@ -356,7 +356,7 @@ define(
{desc: 'smaller than', additionalBytes: -1}
],
function(caseInfo) {
it(`${caseInfo.desc}max file size`, function() {
it(caseInfo.desc + 'max file size', function() {
var maxFileSizeInBytes = this.view.getMaxFileSizeInBytes(),
fileSize = maxFileSizeInBytes + caseInfo.additionalBytes,
fileToUpload = {
@@ -374,7 +374,7 @@ define(
verifyUploadViewInfo(
uploadView,
'Your file could not be uploaded',
`file.mp4 exceeds maximum size of ${videoUploadMaxFileSizeInGB} GB.`
'file.mp4 exceeds maximum size of ' + videoUploadMaxFileSizeInGB + ' GB.'
);
verifyA11YMessage(
StringUtils.interpolate(
@@ -415,10 +415,10 @@ define(
function(caseInfo) {
var fileNames = _.map(
_.range(caseInfo.numFiles),
function(i) { return `test${i}.mp4`; }
function(i) { return 'test' + i + '.mp4'; }
);
describe(`on selection of ${caseInfo.desc}`, function() {
describe('on selection of ' + caseInfo.desc, function() {
beforeEach(function() {
// The files property cannot be set on a file input for
// security reasons, so we must mock the access mechanism
@@ -512,7 +512,7 @@ define(
var refreshDescription = isViewRefresh ? ' (refreshed)' : ' (not refreshed)';
var subCases = [
{
desc: `completion${refreshDescription}`,
desc: 'completion' + refreshDescription,
responseStatus: 204,
statusText: ActiveVideoUpload.STATUS_COMPLETED,
progressValue: 1,
@@ -521,7 +521,7 @@ define(
isViewRefresh: isViewRefresh
},
{
desc: `failure${refreshDescription}`,
desc: 'failure' + refreshDescription,
responseStatus: 500,
statusText: ActiveVideoUpload.STATUS_FAILED,
progressValue: 0,
@@ -533,7 +533,7 @@ define(
_.each(subCases,
function(subCaseInfo) {
describe(`and upload ${subCaseInfo.desc}`, function() {
describe('and upload ' + subCaseInfo.desc, function() {
var refreshSpy = null;
beforeEach(function() {

View File

@@ -276,7 +276,7 @@ function($, AjaxHelpers, URI, AssetsView, AssetCollection, ViewHelpers) {
expect(assetsView).toBeDefined();
var requests = AjaxHelpers.requests(this);
$.each(assetsView.pagingView.filterableColumns, function(columnID, columnData) {
var $typeColumn = $(`#${columnID}`);
var $typeColumn = $('#' + columnID);
assetsView.pagingView.setPage(1);
respondWithMockAssets(requests);
var assetsNumber = assetsView.collection.length;
@@ -292,7 +292,7 @@ function($, AjaxHelpers, URI, AssetsView, AssetCollection, ViewHelpers) {
expect(assetsView).toBeDefined();
setup.call(this, mockExampleAssetsResponse);
$.each(assetsView.pagingView.filterableColumns, function(columnID, columnData) {
var $typeColumn = $(`#${columnID}`);
var $typeColumn = $('#' + columnID);
expect($typeColumn).toBeVisible();
var assetsNumber = $('#asset-table-body .type-col').length;
assetsView.openFilterColumn($typeColumn);
@@ -327,7 +327,7 @@ function($, AjaxHelpers, URI, AssetsView, AssetCollection, ViewHelpers) {
$.each(assetsView.pagingView.filterableColumns, function(columnID, columnData) {
assetsView.pagingView.setPage(1);
respondWithMockAssets(requests);
var $typeColumn = $(`#${columnID}`);
var $typeColumn = $('#' + columnID);
expect($typeColumn).toBeVisible();
var assetsNumber = assetsView.collection.length;
$typeColumn.trigger('click');

View File

@@ -15,7 +15,7 @@ describe('Container View', () => {
verifyRequest, verifyNumReorderCalls, respondToRequest, notificationSpy,
rootLocator = 'locator-container',
containerTestUrl = `/xblock/${rootLocator}`,
containerTestUrl = '/xblock/' + rootLocator,
groupAUrl = '/xblock/locator-group-A',
groupA = 'locator-group-A',
@@ -34,7 +34,7 @@ describe('Container View', () => {
beforeEach(() => {
EditHelpers.installMockXBlock();
EditHelpers.installViewTemplates();
appendSetFixtures(`<div class="wrapper-xblock level-page studio-xblock-wrapper" data-locator="${rootLocator}"></div>`);
appendSetFixtures('<div class="wrapper-xblock level-page studio-xblock-wrapper" data-locator="' + rootLocator + '"></div>');
notificationSpy = EditHelpers.createNotificationSpy();
model = new XBlockInfo({
id: rootLocator,
@@ -80,7 +80,7 @@ describe('Container View', () => {
};
getComponent = function(locator) {
return containerView.$(`.studio-xblock-wrapper[data-locator="${locator}"]`);
return containerView.$('.studio-xblock-wrapper[data-locator="' + locator + '"]');
};
getDragHandle = function(locator) {

View File

@@ -150,10 +150,10 @@ define(
verifyMessage = function(state, message) {
var icon = state === 'error' ? 'fa-info-circle' : 'fa-check-circle';
expect($courseVideoSettingsEl.find(`.course-video-settings-message-wrapper.${state}`).html()).toEqual(
expect($courseVideoSettingsEl.find('.course-video-settings-message-wrapper.' + state).html()).toEqual(
'<div class="course-video-settings-message">'
+ `<span class="icon fa ${icon}" aria-hidden="true"></span>`
+ `<span>${message}</span>`
+ '<span class="icon fa ' + icon + '" aria-hidden="true"></span>'
+ '<span>' + message + '</span>'
+ '</div>'
);
};
@@ -163,7 +163,7 @@ define(
// Check None provider is selected.
expect($transcriptProvidersListEl.find('input[type=radio]:checked').val()).toEqual(selectedProvider.value); // eslint-disable-line max-len
_.each(providers, function(provider, key) {
$transcriptProvidersListEl.find(`label[for=transcript-provider-${key}]`).val(provider.displayName); // eslint-disable-line max-len
$transcriptProvidersListEl.find('label[for=transcript-provider-' + key + ']').val(provider.displayName); // eslint-disable-line max-len
});
};
@@ -219,15 +219,15 @@ define(
};
verifyOrganizationCredentialField = function(fieldName, label) {
var elementSelector = `${courseVideoSettingsView.selectedProvider}-${fieldName}`;
var elementSelector = courseVideoSettingsView.selectedProvider + '-' + fieldName;
// Verify that correct label is shown.
expect(
$courseVideoSettingsEl.find(`.${elementSelector}-wrapper label .title`).html()
$courseVideoSettingsEl.find('.' + elementSelector + '-wrapper label .title').html()
).toEqual(label);
// Verify that credential field is shown.
expect(
$courseVideoSettingsEl.find(`.${elementSelector}-wrapper .${elementSelector}`)
$courseVideoSettingsEl.find('.' + elementSelector + '-wrapper .' + elementSelector)
).toExist();
};
@@ -235,7 +235,7 @@ define(
// Verify that success message is shown.
verifyMessage(
'success',
`${transcriptionPlans[courseVideoSettingsView.selectedProvider].display_name} credentials saved`
transcriptionPlans[courseVideoSettingsView.selectedProvider].display_name + ' credentials saved'
);
// Also verify that transcript credential state is updated.
@@ -253,7 +253,7 @@ define(
if ($courseVideoSettingsEl.find('.selected-transcript-provider').length) {
$courseVideoSettingsEl.find('.selected-transcript-provider .action-change-provider').click();
}
$courseVideoSettingsEl.find(`#transcript-provider-${selectedProvider}`).click();
$courseVideoSettingsEl.find('#transcript-provider-' + selectedProvider).click();
};
resetProvider = function() {
@@ -279,7 +279,7 @@ define(
// Provide organization credentials.
_.each(fieldValues, function(key) {
$courseVideoSettingsEl.find(`.${courseVideoSettingsView.selectedProvider}-${key}`).val(key);
$courseVideoSettingsEl.find('.' + courseVideoSettingsView.selectedProvider + '-' + key).val(key);
});
// Click save organization credentials button to save credentials.
$courseVideoSettingsEl.find('.action-update-org-credentials').click();
@@ -714,8 +714,8 @@ define(
expect($courseVideoSettingsEl.find('.transcription-account-details.warning')).toExist();
// Verify message
expect($courseVideoSettingsEl.find('.transcription-account-details').html()).toEqual(
`<span>This action updates the ${courseVideoSettingsView.selectedProvider
} information for your entire organization.</span>`
'<span>This action updates the ' + courseVideoSettingsView.selectedProvider
+ ' information for your entire organization.</span>'
);
});
@@ -740,12 +740,12 @@ define(
$courseVideoSettingsEl.find('.action-update-org-credentials').click();
verifyPreferanceErrorState(
$courseVideoSettingsEl.find(`.${courseVideoSettingsView.selectedProvider}-api-key-wrapper`),
$courseVideoSettingsEl.find('.' + courseVideoSettingsView.selectedProvider + '-api-key-wrapper'),
true
);
verifyPreferanceErrorState(
$courseVideoSettingsEl.find(`.${courseVideoSettingsView.selectedProvider}-api-secret-wrapper`),
$courseVideoSettingsEl.find('.' + courseVideoSettingsView.selectedProvider + '-api-secret-wrapper'),
true
);
});

View File

@@ -675,9 +675,9 @@ define([
verifyEditingGroup, respondToSave, expectGroupsVisible, correctValidationError;
scopedGroupSelector = function(groupIndex, additionalSelectors) {
var groupSelector = `.partition-groups-list-item-${groupIndex}`;
var groupSelector = '.partition-groups-list-item-' + groupIndex;
if (additionalSelectors) {
return `${groupSelector} ${additionalSelectors}`;
return groupSelector + ' ' + additionalSelectors;
} else {
return groupSelector;
}
@@ -860,7 +860,7 @@ define([
var requests = AjaxHelpers.requests(this),
newGroupName = 'New Group Name',
view = renderView();
editNewGroup(view, {newName: ` ${newGroupName} `, save: true});
editNewGroup(view, {newName: ' ' + newGroupName + ' ', save: true});
respondToSave(requests, view);
expect(view.collection.at(0).get('name')).toBe(newGroupName);
});

View File

@@ -48,7 +48,7 @@ function($, _, AjaxHelpers, TemplateHelpers, ViewHelpers, MoveXBlockModal, XBloc
showModal();
expect(
modal.$el.find('.modal-header .title').contents().get(0).nodeValue.trim()
).toEqual(`Move: ${DISPLAY_NAME}`);
).toEqual('Move: ' + DISPLAY_NAME);
expect(
modal.$el.find('.modal-sr-title').text().trim()
).toEqual('Choose a location to move your component to');

View File

@@ -64,7 +64,7 @@ describe('ModuleEdit', function() {
});
});
describe('render', function() {
beforeEach(function() {
beforeEach(function () {
edit_helpers.installEditTemplates(true);
spyOn(this.moduleEdit, 'loadDisplay');
spyOn(this.moduleEdit, 'delegateEvents');
@@ -124,7 +124,7 @@ describe('ModuleEdit', function() {
});
it('loads the module preview via ajax on the view element', function() {
expect($.ajax).toHaveBeenCalledWith({
url: `/xblock/${this.moduleEdit.model.id}/student_view`,
url: '/xblock/' + this.moduleEdit.model.id + '/student_view',
type: 'GET',
cache: false,
headers: {
@@ -133,7 +133,7 @@ describe('ModuleEdit', function() {
success: jasmine.any(Function)
});
expect($.ajax).not.toHaveBeenCalledWith({
url: `/xblock/${this.moduleEdit.model.id}/studio_view`,
url: '/xblock/' + this.moduleEdit.model.id + '/studio_view',
type: 'GET',
headers: {
Accept: 'application/json'
@@ -146,7 +146,7 @@ describe('ModuleEdit', function() {
it('loads the editing view via ajax on demand', function() {
var mockXBlockEditorHtml;
expect($.ajax).not.toHaveBeenCalledWith({
url: `/xblock/${this.moduleEdit.model.id}/studio_view`,
url: '/xblock/' + this.moduleEdit.model.id + '/studio_view',
type: 'GET',
cache: false,
headers: {
@@ -201,7 +201,7 @@ describe('ModuleEdit', function() {
]
});
expect($.ajax).toHaveBeenCalledWith({
url: `/xblock/${this.moduleEdit.model.id}/studio_view`,
url: '/xblock/' + this.moduleEdit.model.id + '/studio_view',
type: 'GET',
cache: false,
headers: {

View File

@@ -144,8 +144,8 @@ describe('MoveXBlock', function() {
createChildXBlockInfo = function(category, outlineOptions, xblockIndex) {
var childInfo = {
category: categoryMap[category],
display_name: `${category}_display_name_${xblockIndex}`,
id: `${category}_ID_${xblockIndex}`
display_name: category + '_display_name_' + xblockIndex,
id: category + '_ID_' + xblockIndex
};
return createXBlockInfo(parentChildMap[category], outlineOptions, childInfo);
};
@@ -236,11 +236,11 @@ describe('MoveXBlock', function() {
*/
verifyListViewInfo = function(category, expectedXBlocksCount, hasCurrentLocation) {
var displayedInfo = getDisplayedInfo();
expect(displayedInfo.categoryText).toEqual(`${modal.moveXBlockListView.categoriesText[category]}:`);
expect(displayedInfo.categoryText).toEqual(modal.moveXBlockListView.categoriesText[category] + ':');
expect(displayedInfo.xblockCount).toEqual(expectedXBlocksCount);
expect(displayedInfo.xblockDisplayNames).toEqual(
_.map(_.range(expectedXBlocksCount), function(xblockIndex) {
return `${category}_display_name_${xblockIndex}`;
return category + '_display_name_' + xblockIndex;
})
);
if (category === 'component') {
@@ -276,7 +276,7 @@ describe('MoveXBlock', function() {
expect(displayedBreadcrumbs).toEqual(
_.map(visitedCategories, function(visitedCategory) {
return visitedCategory === 'course'
? 'Course Outline' : `${visitedCategory}_display_name_${xblockIndex}`;
? 'Course Outline' : visitedCategory + '_display_name_' + xblockIndex;
})
);
};
@@ -288,7 +288,7 @@ describe('MoveXBlock', function() {
*/
clickForwardButton = function(buttonIndex) {
buttonIndex = buttonIndex || 0; // eslint-disable-line no-param-reassign
modal.moveXBlockListView.$el.find(`[data-item-index="${buttonIndex}"] button`).click();
modal.moveXBlockListView.$el.find('[data-item-index="' + buttonIndex + '"] button').click();
};
/**
@@ -429,7 +429,7 @@ describe('MoveXBlock', function() {
});
modal.$el.find('.modal-actions .action-move').click();
sendMoveXBlockRequest(requests, sourceLocator);
AjaxHelpers.expectJsonRequest(requests, 'GET', `/xblock/${sourceParentLocator}`);
AjaxHelpers.expectJsonRequest(requests, 'GET', '/xblock/' + sourceParentLocator);
AjaxHelpers.respondWithJson(requests, sourceParentXBlockInfo);
expect(getMovedAlertNotification().html().length).not.toEqual(0);
verifyConfirmationFeedbackTitleText(sourceDisplayName);

View File

@@ -19,9 +19,9 @@ function($, _, AjaxHelpers, URI, XBlockInfo, PagedContainer, PagingHeader, Pagin
};
var options = _.extend(default_options, override_options);
return '<div class="xblock" data-request-token="request_token">'
+ `<div class="container-paging-header"></div>${
htmlResponseTpl(options)
}<div class="container-paging-footer"></div>`
+ '<div class="container-paging-header"></div>'
+ htmlResponseTpl(options)
+ '<div class="container-paging-footer"></div>'
+ '</div>';
}
@@ -506,7 +506,7 @@ function($, _, AjaxHelpers, URI, XBlockInfo, PagedContainer, PagingHeader, Pagin
defaultUrl = '/preview/xblock/handler/trigger_previews';
testSendsAjax = function(show_previews) {
it(`should send ${!show_previews} when showChildrenPreviews was ${show_previews}`, function() {
it('should send ' + (!show_previews) + ' when showChildrenPreviews was ' + show_previews, function() {
var requests = AjaxHelpers.requests(this);
pagingContainer.collection.showChildrenPreviews = show_previews;
pagingContainer.togglePreviews();

View File

@@ -15,7 +15,7 @@ import Course from 'js/models/course';
import 'jquery.simulate';
function parameterized_suite(label, globalPageOptions) {
describe(`${label} ContainerPage`, function() {
describe(label + ' ContainerPage', function() {
var getContainerPage, renderContainerPage, handleContainerPageRefresh, expectComponents,
respondWithHtml, model, containerPage, requests, initialDisplayName,
mockContainerPage = readFixtures('templates/mock/mock-container-page.underscore'),
@@ -344,12 +344,12 @@ function parameterized_suite(label, globalPageOptions) {
allComponentsInGroup = _.map(
_.range(NUM_COMPONENTS_PER_GROUP),
function(index) {
return `locator-component-${GROUP_TO_TEST}${index + 1}`;
return 'locator-component-' + GROUP_TO_TEST + (index + 1);
}
);
getGroupElement = function() {
return containerPage.$(`[data-locator='locator-group-${GROUP_TO_TEST}']`);
return containerPage.$("[data-locator='locator-group-" + GROUP_TO_TEST + "']");
};
describe('Deleting an xblock', function() {
@@ -377,7 +377,7 @@ function parameterized_suite(label, globalPageOptions) {
// first request to delete the component
AjaxHelpers.expectJsonRequest(requests, 'DELETE',
`/xblock/locator-component-${GROUP_TO_TEST}${componentIndex + 1}`,
'/xblock/locator-component-' + GROUP_TO_TEST + (componentIndex + 1),
null);
AjaxHelpers.respondWithNoContent(requests);
@@ -489,8 +489,8 @@ function parameterized_suite(label, globalPageOptions) {
// verify content of request
AjaxHelpers.expectJsonRequest(requests, 'POST', '/xblock/', {
duplicate_source_locator: `locator-component-${GROUP_TO_TEST}${componentIndex + 1}`,
parent_locator: `locator-group-${GROUP_TO_TEST}`
duplicate_source_locator: 'locator-component-' + GROUP_TO_TEST + (componentIndex + 1),
parent_locator: 'locator-group-' + GROUP_TO_TEST
});
// send the response
@@ -568,7 +568,7 @@ function parameterized_suite(label, globalPageOptions) {
});
var updatePreviewButtonTest = function(show_previews, expected_text) {
it(`can set preview button to "${expected_text}"`, function() {
it('can set preview button to "' + expected_text + '"', function() {
containerPage = getContainerPage();
containerPage.updatePreviewButton(show_previews);
expect(getButtonText(containerPage)).toBe(expected_text);

View File

@@ -343,15 +343,15 @@ describe('Container Subviews', function() {
it('renders the last published date and user when there are no changes', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({published_on: 'Jul 01, 2014 at 12:45 UTC', published_by: 'amako'});
expect(containerPage.$(lastDraftCss).text())
.toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
expect(containerPage.$(lastDraftCss).text()).
toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
});
it('renders the last saved date and user when there are changes', function() {
renderContainerPage(this, mockContainerXBlockHtml);
fetch({has_changes: true, edited_on: 'Jul 02, 2014 at 14:20 UTC', edited_by: 'joe'});
expect(containerPage.$(lastDraftCss).text())
.toContain('Draft saved on Jul 02, 2014 at 14:20 UTC by joe');
expect(containerPage.$(lastDraftCss).text()).
toContain('Draft saved on Jul 02, 2014 at 14:20 UTC by joe');
});
describe('Release Date', function() {
@@ -596,8 +596,8 @@ describe('Container Subviews', function() {
fetch({
published: true, published_on: 'Jul 01, 2014 at 12:45 UTC', published_by: 'amako'
});
expect(containerPage.$(lastPublishCss).text())
.toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
expect(containerPage.$(lastPublishCss).text()).
toContain('Last published Jul 01, 2014 at 12:45 UTC by amako');
});
it('renders correctly when the block is published without publish info', function() {

View File

@@ -160,11 +160,11 @@ describe('CourseOutlinePage', function() {
};
getItemsOfType = function(type) {
return outlinePage.$(`.outline-${type}`);
return outlinePage.$('.outline-' + type);
};
getItemHeaders = function(type) {
return getItemsOfType(type).find(`> .${type}-header`);
return getItemsOfType(type).find('> .' + type + '-header');
};
verifyItemsExpanded = function(type, isExpanded) {
@@ -210,7 +210,7 @@ describe('CourseOutlinePage', function() {
setSelfPacedCustomPLS = function() {
setSelfPaced();
course.set('is_custom_relative_dates_active', true);
};
}
createCourseOutlinePage = function(test, courseJSON, createOnly) {
requests = AjaxHelpers.requests(test);
@@ -247,7 +247,7 @@ describe('CourseOutlinePage', function() {
createCourseOutlinePageAndShowUnit(this, mockCourseJSON);
getItemHeaders(type).find('.publish-button').click();
$('.wrapper-modal-window .action-publish').click();
AjaxHelpers.expectJsonRequest(requests, 'POST', `/xblock/mock-${type}`, {
AjaxHelpers.expectJsonRequest(requests, 'POST', '/xblock/mock-' + type, {
publish: 'make_public'
});
expect(requests[0].requestHeaders['X-HTTP-Method-Override']).toBe('PATCH');
@@ -688,7 +688,7 @@ describe('CourseOutlinePage', function() {
var highlights = [],
i;
for (i = 0; i < numberOfHighlights; i++) {
highlights.push(`Highlight${i + 1}`);
highlights.push('Highlight' + (i + 1));
}
return highlights;
};
@@ -1073,7 +1073,7 @@ describe('CourseOutlinePage', function() {
};
setContentVisibility = function(visibility) {
$(`input[name=content-visibility][value=${visibility}]`).prop('checked', true);
$('input[name=content-visibility][value=' + visibility + ']').prop('checked', true);
};
selectDisableSpecialExams = function() {
@@ -1122,7 +1122,7 @@ describe('CourseOutlinePage', function() {
};
expectShowCorrectness = function(showCorrectness) {
expect($(`input[name=show-correctness][value=${showCorrectness}]`).is(':checked')).toBe(true);
expect($('input[name=show-correctness][value=' + showCorrectness + ']').is(':checked')).toBe(true);
};
getMockNoPrereqOrExamsCourseJSON = function() {
@@ -1440,7 +1440,7 @@ describe('CourseOutlinePage', function() {
$('.wrapper-modal-window .action-save').click();
});
it('can select the onboarding exam when a course supports onboarding', function() {
it('can select the onboarding exam when a course supports onboarding', function () {
var mockCourseWithSpecialExamJSON = createMockCourseJSON({}, [
createMockSectionJSON({
has_changes: true,
@@ -2090,12 +2090,12 @@ describe('CourseOutlinePage', function() {
var setShowCorrectness;
setShowCorrectness = function(showCorrectness) {
$(`input[name=show-correctness][value=${showCorrectness}]`).click();
$('input[name=show-correctness][value=' + showCorrectness + ']').click();
};
describe('Show correctness set by subsection metadata.', function() {
$.each(['always', 'never', 'past_due'], function(index, showCorrectness) {
it(`show_correctness="${showCorrectness}"`, function() {
it('show_correctness="' + showCorrectness + '"', function() {
var mockCourseJSONCorrectness = createMockCourseJSON({}, [
createMockSectionJSON({}, [
createMockSubsectionJSON({show_correctness: showCorrectness}, [])
@@ -2124,7 +2124,7 @@ describe('CourseOutlinePage', function() {
});
$.each(['never', 'past_due'], function(index, showCorrectness) {
it(`show_correctness="${showCorrectness}" updates settings, republishes`, function() {
it('show_correctness="' + showCorrectness + '" updates settings, republishes', function() {
var expectedSettings = $.extend(true, {}, defaultModalSettings, {publish: 'republish'});
expectedSettings.metadata.show_correctness = showCorrectness;
@@ -2173,7 +2173,7 @@ describe('CourseOutlinePage', function() {
expect($modalWindow.find('.outline-subsection')).not.toExist();
});
describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function() {
describe('Self Paced with Custom Personalized Learner Schedules (PLS)', function () {
beforeEach(function() {
var mockCourseJSON = createMockCourseJSON({}, [
createMockSectionJSON({}, [
@@ -2192,7 +2192,7 @@ describe('CourseOutlinePage', function() {
selectRelativeWeeksSubsection = function(weeks) {
$('#due_in').val(weeks).trigger('keyup');
};
}
mockCustomPacingServerValuesJson = createMockSectionJSON({
release_date: 'Jan 01, 2970 at 05:00 UTC'
@@ -2217,7 +2217,7 @@ describe('CourseOutlinePage', function() {
])
]);
it('can show correct editors for self_paced course with custom pacing', function() {
it('can show correct editors for self_paced course with custom pacing', function (){
outlinePage.$('.outline-subsection .configure-button').click();
expect($('.edit-settings-release').length).toBe(0);
// Due date input exists for custom pacing self paced courses
@@ -2286,7 +2286,7 @@ describe('CourseOutlinePage', function() {
$('#grading_type').val('notgraded').trigger('change');
$('#due_in').val('').trigger('change');
expect($('#relative_date_input').css('display')).toBe('none');
});
})
it('shows validation error on relative date', function() {
outlinePage.$('.outline-subsection .configure-button').click();
@@ -2353,7 +2353,7 @@ describe('CourseOutlinePage', function() {
'Contains staff only content'
);
});
});
})
});
// Note: most tests for units can be found in Bok Choy
@@ -2452,7 +2452,7 @@ describe('CourseOutlinePage', function() {
expect(messages).toContainText('Contains staff only content');
});
describe('discussion settings', function() {
describe('discussion settings', function () {
it('hides discussion settings if unit level discussions are disabled', function() {
getUnitStatus({}, {unit_level_discussions: false});
outlinePage.$('.outline-unit .configure-button').click();

View File

@@ -10,8 +10,8 @@ function($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
var team_member_fixture = readFixtures('team-member.underscore');
function setRole(email, role) {
var $user_li = $(`li.user-item[data-email="${email}"]`);
var $role_action = $(`li.action-role a.make-${role}`, $user_li);
var $user_li = $('li.user-item[data-email="' + email + '"]');
var $role_action = $('li.action-role a.make-' + role, $user_li);
expect($role_action).toBeVisible();
$role_action.click();
}
@@ -110,7 +110,7 @@ function($, AjaxHelpers, ViewHelpers, ManageUsersFactory, ViewUtils) {
var promptSpy = ViewHelpers.createPromptSpy();
var reloadSpy = spyOn(ViewUtils, 'reload');
var email = 'honor@example.com';
$(`.user-item[data-email="${email}"] .action-delete .delete`).click();
$('.user-item[data-email="' + email + '"] .action-delete .delete').click();
ViewHelpers.verifyPromptShowing(promptSpy, 'Are you sure?');
ViewHelpers.confirmPrompt(promptSpy);
ViewHelpers.verifyPromptHidden(promptSpy);

View File

@@ -10,7 +10,7 @@ function($, URI, AjaxHelpers, PagingCollection, PagingView, PagingHeader) {
'use strict';
var createPageableItem = function(index) {
var id = `item_${index}`;
var id = 'item_' + index;
return {
id: id,
display_name: id,

View File

@@ -20,7 +20,7 @@ define(
_.range(numModels),
function(num, index) {
return new Backbone.Model(
_.extend({}, modelData, {edx_video_id: `dummy_id_${index}`})
_.extend({}, modelData, {edx_video_id: 'dummy_id_' + index})
);
}
)
@@ -66,7 +66,7 @@ define(
if (confirmRemove) {
// click on Remove button on confirmation popup
$('.action-primary').click();
AjaxHelpers.expectJsonRequest(requests, 'DELETE', `${videoHandlerUrl}/dummy_id_0`);
AjaxHelpers.expectJsonRequest(requests, 'DELETE', videoHandlerUrl + '/dummy_id_0');
AjaxHelpers.respondWithNoContent(requests);
numVideos -= 1;
firstVideoId = 'dummy_id_1';

View File

@@ -49,7 +49,7 @@ define(
},
collection = new Backbone.Collection(_.map(_.range(numVideos), function(num, index) {
return new Backbone.Model(
_.extend({}, defaultData, {edx_video_id: `dummy_id_${index}`}, modelData)
_.extend({}, defaultData, {edx_video_id: 'dummy_id_' + index}, modelData)
);
}));
videoListView = new PreviousVideoUploadListView({
@@ -192,7 +192,7 @@ define(
AjaxHelpers.expectRequest(
requests,
'POST',
`${IMAGE_UPLOAD_URL}/dummy_id_${videoViewIndex}`,
IMAGE_UPLOAD_URL + '/dummy_id_' + videoViewIndex,
new FormData()
);
@@ -221,7 +221,7 @@ define(
it('calls readMessage with correct message', function() {
var errorMessage = 'Image upload failed. This image file type is not supported. Supported file '
+ `types are ${videoThumbnailView.getVideoImageSupportedFileFormats().humanize}.`,
+ 'types are ' + videoThumbnailView.getVideoImageSupportedFileFormats().humanize + '.',
successData = {
files: [createFakeImageFile()],
submit: function() {}
@@ -270,8 +270,8 @@ define(
// Verify error message
expect($videoListEl.find('.thumbnail-error-wrapper').find('.action-text').html()
.trim()).toEqual(
`Image upload failed. The selected image must be larger than ${
videoThumbnailView.getVideoImageMinSize().humanize}.`
'Image upload failed. The selected image must be larger than '
+ videoThumbnailView.getVideoImageMinSize().humanize + '.'
);
});
@@ -285,8 +285,8 @@ define(
// Verify error message
expect($videoListEl.find('.thumbnail-error-wrapper').find('.action-text').html()
.trim()).toEqual(
`Image upload failed. The selected image must be smaller than ${
videoThumbnailView.getVideoImageMaxSize().humanize}.`
'Image upload failed. The selected image must be smaller than '
+ videoThumbnailView.getVideoImageMaxSize().humanize + '.'
);
});
@@ -322,8 +322,8 @@ define(
// Verify error message
expect($videoListEl.find('.thumbnail-error-wrapper').find('.action-text').html()
.trim()).toEqual(
`Image upload failed. This image file type is not supported. Supported file types are ${
videoThumbnailView.getVideoImageSupportedFileFormats().humanize}.`
'Image upload failed. This image file type is not supported. Supported file types are '
+ videoThumbnailView.getVideoImageSupportedFileFormats().humanize + '.'
);
});

View File

@@ -61,7 +61,7 @@ define(
expect(downloadTranscriptActionEl.html().trim(), 'Download');
expect(
downloadTranscriptActionEl.attr('href'),
`${TRANSCRIPT_DOWNLOAD_URL}?edx_video_id=${edxVideoID}&language_code=${transcriptLanguage}`
TRANSCRIPT_DOWNLOAD_URL + '?edx_video_id=' + edxVideoID + '&language_code=' + transcriptLanguage
);
expect(uploadTranscriptActionEl.html().trim(), 'Replace');
@@ -143,7 +143,7 @@ define(
videoTranscriptsView.$el.find('.video-transcripts-wrapper').hasClass('hidden')
).toEqual(true);
expect(videoTranscriptsView.$el.find('.toggle-show-transcripts-button-text').html().trim()).toEqual(
`Show transcripts (${transcripts.length})`
'Show transcripts (' + transcripts.length + ')'
);
});
@@ -155,7 +155,7 @@ define(
// Verify initial button text
expect(videoTranscriptsView.$el.find('.toggle-show-transcripts-button-text').html().trim()).toEqual(
`Show transcripts (${transcripts.length})`
'Show transcripts (' + transcripts.length + ')'
);
videoTranscriptsView.$el.find('.toggle-show-transcripts-button').click();
@@ -166,7 +166,7 @@ define(
// Verify button text is changed.
expect(videoTranscriptsView.$el.find('.toggle-show-transcripts-button-text').html().trim()).toEqual(
`Hide transcripts (${transcripts.length})`
'Hide transcripts (' + transcripts.length + ')'
);
});
@@ -176,7 +176,7 @@ define(
// Verify button text.
expect(videoTranscriptsView.$el.find('.toggle-show-transcripts-button-text').html().trim()).toEqual(
`Hide transcripts (${transcripts.length})`
'Hide transcripts (' + transcripts.length + ')'
);
// Verify transcript container is not hidden
@@ -188,7 +188,7 @@ define(
// Verify button text is changed.
expect(videoTranscriptsView.$el.find('.toggle-show-transcripts-button-text').html().trim()).toEqual(
`Show transcripts (${transcripts.length})`
'Show transcripts (' + transcripts.length + ')'
);
// Verify transcript container is hidden
@@ -216,10 +216,10 @@ define(
);
_.each(transcripts, function(languageCode) {
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
// Verify correct transcript title is set.
expect($transcriptEl.find('.transcript-title').html()).toEqual(
`Video client title n_${languageCode}.${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}`
'Video client title n_' + languageCode + '.' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT
);
// Verify transcript is rendered with correct info.
verifyTranscriptStateInfo($transcriptEl, languageCode);
@@ -230,11 +230,11 @@ define(
var languageCode = 'en',
newLanguageCode = 'ar',
requests = AjaxHelpers.requests(this),
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
// Verify correct transcript title is set.
expect($transcriptEl.find('.transcript-title').html()).toEqual(
`Video client title n_${languageCode}.${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}`
'Video client title n_' + languageCode + '.' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT
);
// Select a language
@@ -257,7 +257,7 @@ define(
// Verify correct transcript title is set.
expect($transcriptEl.find('.transcript-title').html()).toEqual(
`Video client title n_${newLanguageCode}.${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}`
'Video client title n_' + newLanguageCode + '.' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT
);
verifyMessage($transcriptEl, 'uploaded');
@@ -269,11 +269,11 @@ define(
it('can delete transcript', function() {
var languageCode = 'en',
requests = AjaxHelpers.requests(this),
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
// Verify correct transcript title is set.
expect($transcriptEl.find('.transcript-title').html()).toEqual(
`Video client title n_${languageCode}.${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}`
'Video client title n_' + languageCode + '.' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT
);
$transcriptEl.find('.delete-transcript-button').click();
@@ -285,7 +285,7 @@ define(
AjaxHelpers.expectRequest(
requests,
'DELETE',
`${TRANSCRIPT_DELETE_URL}/${edxVideoID}/${languageCode}`
TRANSCRIPT_DELETE_URL + '/' + edxVideoID + '/' + languageCode
);
// Send successful delete response
@@ -293,7 +293,7 @@ define(
// Verify English transcript is not present.
expect(videoTranscriptsView.$el.find(
`.video-transcript-content[data-language-code="${languageCode}"]`
'.video-transcript-content[data-language-code="' + languageCode + '"]'
)).not.toExist();
// Verify transcripts view is rendered with transcript deleted for English.
@@ -305,11 +305,11 @@ define(
it('should show error message when deleting a transcript in case of server error', function() {
var languageCode = 'en',
requests = AjaxHelpers.requests(this),
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
// Verify correct transcript title is set.
expect($transcriptEl.find('.transcript-title').html()).toEqual(
`Video client title n_${languageCode}.${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}`
'Video client title n_' + languageCode + '.' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT
);
$transcriptEl.find('.delete-transcript-button').click();
@@ -331,7 +331,7 @@ define(
AjaxHelpers.expectRequest(
requests,
'DELETE',
`${TRANSCRIPT_DELETE_URL}/${edxVideoID}/${languageCode}`
TRANSCRIPT_DELETE_URL + '/' + edxVideoID + '/' + languageCode
);
AjaxHelpers.respondWithError(requests, 500);
@@ -343,7 +343,7 @@ define(
// Verify English transcript container is not removed.
expect(videoTranscriptsView.$el.find(
`.video-transcript-content[data-language-code="${languageCode}"]`
'.video-transcript-content[data-language-code="' + languageCode + '"]'
)).toExist();
// Verify transcripts count is correct.
@@ -356,7 +356,7 @@ define(
var languageCode = 'en',
requests = AjaxHelpers.requests(this),
errorMessage = 'Transcript failed error message',
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
$transcriptEl.find('.upload-transcript-button').click();
@@ -382,7 +382,7 @@ define(
it('should show error message in case of server error', function() {
var languageCode = 'en',
requests = AjaxHelpers.requests(this),
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
$transcriptEl.find('.upload-transcript-button').click();
@@ -407,8 +407,8 @@ define(
it('should show error message in case of unsupported transcript file format', function() {
var languageCode = 'en',
transcriptFileName = 'unsupported-transcript-file-format.txt',
errorMessage = `This file type is not supported. Supported file type is ${TRANSCRIPT_DOWNLOAD_FILE_FORMAT}.`, // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find(`.video-transcript-content[data-language-code="${languageCode}"]`); // eslint-disable-line max-len
errorMessage = 'This file type is not supported. Supported file type is ' + TRANSCRIPT_DOWNLOAD_FILE_FORMAT + '.', // eslint-disable-line max-len
$transcriptEl = videoTranscriptsView.$el.find('.video-transcript-content[data-language-code="' + languageCode + '"]'); // eslint-disable-line max-len
$transcriptEl.find('.upload-transcript-button').click();

View File

@@ -36,7 +36,7 @@ describe('XBlockStringFieldEditorView', function() {
'<div class="wrapper-xblock-field incontext-editor is-editable"'
+ 'data-field="display_name" data-field-display-name="Display Name">'
+ '<h1 class="page-header-title xblock-field-value incontext-editor-value">'
+ `<span class="title-value">${initialDisplayName}</span>`
+ '<span class="title-value">' + initialDisplayName + '</span>'
+ '</h1>'
+ '</div>'
);
@@ -149,11 +149,11 @@ describe('XBlockStringFieldEditorView', function() {
});
it('renders open angle bracket in input field', function() {
expectInputMatchesModelDisplayName(`${updatedDisplayName}<`);
expectInputMatchesModelDisplayName(updatedDisplayName + '<');
});
it('renders close angle bracket in input field', function() {
expectInputMatchesModelDisplayName(`>${updatedDisplayName}`);
expectInputMatchesModelDisplayName('>' + updatedDisplayName);
});
});
});

View File

@@ -110,8 +110,8 @@ define(['jquery', 'js/models/xblock_validation', 'js/views/xblock_validation', '
it('renders action info', function() {
expect(view.$('a.edit-button .action-button-text').text()).toContain('Summary Action');
expect(view.$('a.notification-action-button .action-button-text').text())
.toContain('First Message Action');
expect(view.$('a.notification-action-button .action-button-text').text()).
toContain('First Message Action');
expect(view.$('a.notification-action-button').data('notification-action')).toBe('fix-up');
});