Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8869: Add innerHTML lint check #8870

Merged
merged 10 commits into from
Mar 28, 2020
Prev Previous commit
Next Next commit
fix errors from before linter was introduced
  • Loading branch information
Kevin Thomas committed Mar 19, 2020
commit e53624d3b3f25456b49871075d93e9fdb00b2245
3 changes: 2 additions & 1 deletion extensions/interactions/CodeRepl/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
* Editor.
*/

var waitFor = require('../../../core/tests/protractor_utils/waitFor.js');
var waitFor = require(
process.cwd() + 'core/tests/protractor_utils/waitFor.js');

var customizeInteraction = function(interactionEditor, placeHolderText) {
browser.executeScript(
Expand Down
5 changes: 3 additions & 2 deletions extensions/interactions/Continue/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
* interaction.
*/

var objects = require('../../objects/protractor.js');
var waitFor = require('../../../core/tests/protractor_utils/waitFor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');
var waitFor = require(
process.cwd() + 'core/tests/protractor_utils/waitFor.js');

var customizeInteraction = function(elem, buttonText) {
if (buttonText) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/interactions/EndExploration/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* interaction.
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');
/**
* Add recommended exploration Id to End Exploration interaction.
* @param {Object} elem - The Customize Exploration modal for End Exploration.
Expand Down
2 changes: 1 addition & 1 deletion extensions/interactions/FractionInput/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview End-to-end testing utilities for the Fraction interaction.
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeInteraction = function(elem, requireSimplestForm) {
objects.BooleanEditor(elem.element(by.tagName('schema-based-bool-editor')))
Expand Down
6 changes: 3 additions & 3 deletions extensions/interactions/GraphInput/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
* @fileoverview End-to-end testing utilities for the GraphInput interaction.
*/

var forms = require('../../../core/tests/protractor_utils/forms.js');
var objects = require('../../objects/protractor.js');
var waitFor = require('../../../core/tests/protractor_utils/waitFor.js');
var forms = require(process.cwd() + 'core/tests/protractor_utils/forms.js');
var waitFor = require(
process.cwd() + 'core/tests/protractor_utils/waitFor.js');

var customizeInteraction = function(interactionEditor, graphDict) {
var graphInputContainer = interactionEditor.element(by.css(
Expand Down
2 changes: 0 additions & 2 deletions extensions/interactions/LogicProof/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* @fileoverview End-to-end testing utilities for the LogicProof interaction.
*/

var objects = require('../../objects/protractor.js');

var customizeInteraction = function(elem, assumption, target, defaultText) {
elem.element(by.id('logicQuestionAssumptions')).sendKeys(assumption);
elem.element(by.id('logicQuestionTarget')).sendKeys(target);
Expand Down
2 changes: 0 additions & 2 deletions extensions/interactions/MathExpressionInput/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* interaction
*/

var objects = require('../../objects/protractor.js');

var mathExpressionInputTag = function(parentElement) {
return parentElement.element(by.tagName(
'oppia-interactive-math-expression-input'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* interaction.
*/

var forms = require('../../../core/tests/protractor_utils/forms.js');
var forms = require(process.cwd() + 'core/tests/protractor_utils/forms.js');

// The members of richTextInstructionsArray are functions, one for each option,
// which will each be passed a 'handler' that they can use to edit the
Expand Down
2 changes: 0 additions & 2 deletions extensions/interactions/NumberWithUnits/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* Interaction.
*/

var objects = require('../../objects/protractor.js');

var customizeInteraction = function() {
// There are no customizations.
};
Expand Down
2 changes: 0 additions & 2 deletions extensions/interactions/NumericInput/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* interaction.
*/

var objects = require('../../objects/protractor.js');

var customizeInteraction = function() {
// There are no customizations.
};
Expand Down
2 changes: 1 addition & 1 deletion extensions/interactions/TextInput/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview End-to-end testing utilities for the Text interaction.
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeInteraction = function(elem, placeholderText, heightOfBox) {
objects.UnicodeStringEditor(
Expand Down
2 changes: 0 additions & 2 deletions extensions/objects/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* tests.
*/

var forms = require('../../core/tests/protractor_utils/forms.js');

// NOTE: all editors for objects that are used as parameters in a rule must
// implement a setValue() function to which a single argument can be sent
// that will completely determine the object.
Expand Down
3 changes: 1 addition & 2 deletions extensions/rich_text_components/Collapsible/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
* end-to-end testing with Protractor.js
*/

var forms = require('../../../core/tests/protractor_utils/forms.js');
var general = require('../../../core/tests/protractor_utils/general.js');
var forms = require(process.cwd() + 'core/tests/protractor_utils/forms.js');

var customizeComponent = function(modal, heading, contentInstructions) {
forms.UnicodeEditor(
Expand Down
2 changes: 1 addition & 1 deletion extensions/rich_text_components/Image/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* testing with Protractor.js
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeComponent = function(modal, filepath, name) {
modal.element(by.tagName('button')).click();
Expand Down
2 changes: 1 addition & 1 deletion extensions/rich_text_components/Link/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* end-to-end testing with Protractor.js
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeComponent = function(modal, url) {
objects.SanitizedUrlEditor(
Expand Down
2 changes: 1 addition & 1 deletion extensions/rich_text_components/Math/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* end-to-end testing with Protractor.js
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeComponent = function(modal, rawLatex) {
objects.MathLatexStringEditor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* end-to-end testing with Protractor.js
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeComponent = function(modal, index) {
objects.SkillSelector(
Expand Down
2 changes: 1 addition & 1 deletion extensions/rich_text_components/Tabs/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* end-to-end testing with Protractor.js
*/

var forms = require('../../../core/tests/protractor_utils/forms.js');
var forms = require(process.cwd() + 'core/tests/protractor_utils/forms.js');

// The 'tabArray' arg should be an array of dictionaries with keys:
// 'title': a string
Expand Down
2 changes: 1 addition & 1 deletion extensions/rich_text_components/Video/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* end-to-end testing with Protractor.js
*/

var objects = require('../../objects/protractor.js');
var objects = require(process.cwd() + 'extensions/objects/protractor.js');

var customizeComponent = function(
modal, youtubeId, startTime, endTime, ifAutoplay) {
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_file_contents(filepath, raw_bytes=False, mode='r'):
*. Either the raw_bytes stream if the flag is set or the
decoded stream in utf-8 format.
"""
with open(filepath, mode) as f:
with python_utils.open_file(filepath, mode) as f:
return f.read() if raw_bytes else f.read().decode('utf-8')


Expand Down