Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-17 10:13:26 +0300
committerMike Greiling <mike@pixelcog.com>2018-10-17 19:18:17 +0300
commitf666026d71ebefd70219d5078b1f0c83fa01f84d (patch)
treece43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/notebook
parent5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff)
Prettify all spec files
Diffstat (limited to 'spec/javascripts/notebook')
-rw-r--r--spec/javascripts/notebook/cells/code_spec.js4
-rw-r--r--spec/javascripts/notebook/cells/markdown_spec.js30
-rw-r--r--spec/javascripts/notebook/cells/output/html_sanitize_tests.js8
-rw-r--r--spec/javascripts/notebook/cells/output/html_spec.js2
-rw-r--r--spec/javascripts/notebook/cells/output/index_spec.js14
-rw-r--r--spec/javascripts/notebook/cells/prompt_spec.js4
-rw-r--r--spec/javascripts/notebook/index_spec.js10
7 files changed, 35 insertions, 37 deletions
diff --git a/spec/javascripts/notebook/cells/code_spec.js b/spec/javascripts/notebook/cells/code_spec.js
index 0c432d73f67..4659b83d1b6 100644
--- a/spec/javascripts/notebook/cells/code_spec.js
+++ b/spec/javascripts/notebook/cells/code_spec.js
@@ -12,7 +12,7 @@ describe('Code component', () => {
});
describe('without output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
cell: json.cells[0],
@@ -31,7 +31,7 @@ describe('Code component', () => {
});
describe('with output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
cell: json.cells[2],
diff --git a/spec/javascripts/notebook/cells/markdown_spec.js b/spec/javascripts/notebook/cells/markdown_spec.js
index 0b1b11de1fd..540fc8a21f1 100644
--- a/spec/javascripts/notebook/cells/markdown_spec.js
+++ b/spec/javascripts/notebook/cells/markdown_spec.js
@@ -11,7 +11,7 @@ describe('Markdown component', () => {
let cell;
let json;
- beforeEach((done) => {
+ beforeEach(done => {
json = getJSONFixture('blob/notebook/basic.json');
// eslint-disable-next-line prefer-destructuring
@@ -34,18 +34,18 @@ describe('Markdown component', () => {
});
it('does not render the markdown text', () => {
- expect(
- vm.$el.querySelector('.markdown').innerHTML.trim(),
- ).not.toEqual(cell.source.join(''));
+ expect(vm.$el.querySelector('.markdown').innerHTML.trim()).not.toEqual(cell.source.join(''));
});
it('renders the markdown HTML', () => {
expect(vm.$el.querySelector('.markdown h1')).not.toBeNull();
});
- it('sanitizes output', (done) => {
+ it('sanitizes output', done => {
Object.assign(cell, {
- source: ['[XSS](data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+Cg==)\n'],
+ source: [
+ '[XSS](data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+Cg==)\n',
+ ],
});
Vue.nextTick(() => {
@@ -60,7 +60,7 @@ describe('Markdown component', () => {
json = getJSONFixture('blob/notebook/math.json');
});
- it('renders multi-line katex', (done) => {
+ it('renders multi-line katex', done => {
vm = new Component({
propsData: {
cell: json.cells[0],
@@ -68,15 +68,13 @@ describe('Markdown component', () => {
}).$mount();
Vue.nextTick(() => {
- expect(
- vm.$el.querySelector('.katex'),
- ).not.toBeNull();
+ expect(vm.$el.querySelector('.katex')).not.toBeNull();
done();
});
});
- it('renders inline katex', (done) => {
+ it('renders inline katex', done => {
vm = new Component({
propsData: {
cell: json.cells[1],
@@ -84,15 +82,13 @@ describe('Markdown component', () => {
}).$mount();
Vue.nextTick(() => {
- expect(
- vm.$el.querySelector('p:first-child .katex'),
- ).not.toBeNull();
+ expect(vm.$el.querySelector('p:first-child .katex')).not.toBeNull();
done();
});
});
- it('renders multiple inline katex', (done) => {
+ it('renders multiple inline katex', done => {
vm = new Component({
propsData: {
cell: json.cells[1],
@@ -100,9 +96,7 @@ describe('Markdown component', () => {
}).$mount();
Vue.nextTick(() => {
- expect(
- vm.$el.querySelectorAll('p:nth-child(2) .katex').length,
- ).toBe(4);
+ expect(vm.$el.querySelectorAll('p:nth-child(2) .katex').length).toBe(4);
done();
});
diff --git a/spec/javascripts/notebook/cells/output/html_sanitize_tests.js b/spec/javascripts/notebook/cells/output/html_sanitize_tests.js
index d587573fc9e..844a1841c81 100644
--- a/spec/javascripts/notebook/cells/output/html_sanitize_tests.js
+++ b/spec/javascripts/notebook/cells/output/html_sanitize_tests.js
@@ -28,7 +28,8 @@ export default {
output: '<a>foo</a>',
},
'protocol-based JS injection: long UTF-8 encoding without semicolons': {
- input: '<a href=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>foo</a>',
+ input:
+ '<a href=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>foo</a>',
output: '<a>foo</a>',
},
'protocol-based JS injection: hex encoding': {
@@ -40,7 +41,8 @@ export default {
output: '<a>foo</a>',
},
'protocol-based JS injection: hex encoding without semicolons': {
- input: '<a href=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>foo</a>',
+ input:
+ '<a href=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>foo</a>',
output: '<a>foo</a>',
},
'protocol-based JS injection: null char': {
@@ -48,7 +50,7 @@ export default {
output: '<a>foo</a>',
},
'protocol-based JS injection: invalid URL char': {
- input: '<img src=java\script:alert("XSS")>', // eslint-disable-line no-useless-escape
+ input: '<img src=javascript:alert("XSS")>', // eslint-disable-line no-useless-escape
output: '<img>',
},
'protocol-based JS injection: Unicode': {
diff --git a/spec/javascripts/notebook/cells/output/html_spec.js b/spec/javascripts/notebook/cells/output/html_spec.js
index 9c5385f2922..bea62f54634 100644
--- a/spec/javascripts/notebook/cells/output/html_spec.js
+++ b/spec/javascripts/notebook/cells/output/html_spec.js
@@ -14,7 +14,7 @@ describe('html output cell', () => {
}
describe('sanitizes output', () => {
- Object.keys(sanitizeTests).forEach((key) => {
+ Object.keys(sanitizeTests).forEach(key => {
it(key, () => {
const test = sanitizeTests[key];
const vm = createComponent(test.input);
diff --git a/spec/javascripts/notebook/cells/output/index_spec.js b/spec/javascripts/notebook/cells/output/index_spec.js
index dbf79f85c7c..feab7ad4212 100644
--- a/spec/javascripts/notebook/cells/output/index_spec.js
+++ b/spec/javascripts/notebook/cells/output/index_spec.js
@@ -7,7 +7,7 @@ describe('Output component', () => {
let vm;
let json;
- const createComponent = (output) => {
+ const createComponent = output => {
vm = new Component({
propsData: {
output,
@@ -22,7 +22,7 @@ describe('Output component', () => {
});
describe('text output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
createComponent(json.cells[2].outputs[0]);
setTimeout(() => {
@@ -40,7 +40,7 @@ describe('Output component', () => {
});
describe('image output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
createComponent(json.cells[3].outputs[0]);
setTimeout(() => {
@@ -58,7 +58,7 @@ describe('Output component', () => {
});
describe('html output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
createComponent(json.cells[4].outputs[0]);
setTimeout(() => {
@@ -77,7 +77,7 @@ describe('Output component', () => {
});
describe('svg output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
createComponent(json.cells[5].outputs[0]);
setTimeout(() => {
@@ -95,7 +95,7 @@ describe('Output component', () => {
});
describe('default to plain text', () => {
- beforeEach((done) => {
+ beforeEach(done => {
createComponent(json.cells[6].outputs[0]);
setTimeout(() => {
@@ -112,7 +112,7 @@ describe('Output component', () => {
expect(vm.$el.querySelector('.prompt span')).not.toBeNull();
});
- it('renders as plain text when doesn\'t recognise other types', (done) => {
+ it("renders as plain text when doesn't recognise other types", done => {
createComponent(json.cells[7].outputs[0]);
setTimeout(() => {
diff --git a/spec/javascripts/notebook/cells/prompt_spec.js b/spec/javascripts/notebook/cells/prompt_spec.js
index 207fa433a59..cbbcb1e68e3 100644
--- a/spec/javascripts/notebook/cells/prompt_spec.js
+++ b/spec/javascripts/notebook/cells/prompt_spec.js
@@ -7,7 +7,7 @@ describe('Prompt component', () => {
let vm;
describe('input', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
type: 'In',
@@ -31,7 +31,7 @@ describe('Prompt component', () => {
});
describe('output', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
type: 'Out',
diff --git a/spec/javascripts/notebook/index_spec.js b/spec/javascripts/notebook/index_spec.js
index bd63ab35426..2e2ea5ad8af 100644
--- a/spec/javascripts/notebook/index_spec.js
+++ b/spec/javascripts/notebook/index_spec.js
@@ -14,7 +14,7 @@ describe('Notebook component', () => {
});
describe('without JSON', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
notebook: {},
@@ -33,7 +33,7 @@ describe('Notebook component', () => {
});
describe('with JSON', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
notebook: json,
@@ -65,7 +65,7 @@ describe('Notebook component', () => {
});
describe('with worksheets', () => {
- beforeEach((done) => {
+ beforeEach(done => {
vm = new Component({
propsData: {
notebook: jsonWithWorksheet,
@@ -80,7 +80,9 @@ describe('Notebook component', () => {
});
it('renders cells', () => {
- expect(vm.$el.querySelectorAll('.cell').length).toBe(jsonWithWorksheet.worksheets[0].cells.length);
+ expect(vm.$el.querySelectorAll('.cell').length).toBe(
+ jsonWithWorksheet.worksheets[0].cells.length,
+ );
});
it('renders markdown cell', () => {