mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-09 00:59:02 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -15,75 +15,75 @@ const sinon = require('sinon')
|
||||
const modulePath = '../../../../app/src/Features/Project/DocLinesComparitor.js'
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
|
||||
describe('doc lines comparitor', function() {
|
||||
beforeEach(function() {
|
||||
describe('doc lines comparitor', function () {
|
||||
beforeEach(function () {
|
||||
return (this.comparitor = SandboxedModule.require(modulePath, {}))
|
||||
})
|
||||
|
||||
it('should return true when the lines are the same', function() {
|
||||
it('should return true when the lines are the same', function () {
|
||||
const lines1 = ['hello', 'world']
|
||||
const lines2 = ['hello', 'world']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(true)
|
||||
})
|
||||
|
||||
it('should return false when the lines are different', function() {
|
||||
it('should return false when the lines are different', function () {
|
||||
const lines1 = ['hello', 'world']
|
||||
const lines2 = ['diff', 'world']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return false when the lines are different', function() {
|
||||
it('should return false when the lines are different', function () {
|
||||
const lines1 = ['hello', 'world']
|
||||
const lines2 = ['hello', 'wrld']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return true when the lines are same', function() {
|
||||
it('should return true when the lines are same', function () {
|
||||
const lines1 = ['hello', 'world']
|
||||
const lines2 = ['hello', 'world']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(true)
|
||||
})
|
||||
|
||||
it('should return false if the doc lines are different in length', function() {
|
||||
it('should return false if the doc lines are different in length', function () {
|
||||
const lines1 = ['hello', 'world']
|
||||
const lines2 = ['hello', 'world', 'please']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return false if the first array is undefined', function() {
|
||||
it('should return false if the first array is undefined', function () {
|
||||
const lines1 = undefined
|
||||
const lines2 = ['hello', 'world']
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return false if the second array is undefined', function() {
|
||||
it('should return false if the second array is undefined', function () {
|
||||
const lines1 = ['hello']
|
||||
const lines2 = undefined
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return false if the second array is not an array', function() {
|
||||
it('should return false if the second array is not an array', function () {
|
||||
const lines1 = ['hello']
|
||||
const lines2 = ''
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(false)
|
||||
})
|
||||
|
||||
it('should return true when comparing equal orchard docs', function() {
|
||||
it('should return true when comparing equal orchard docs', function () {
|
||||
const lines1 = [{ text: 'hello world' }]
|
||||
const lines2 = [{ text: 'hello world' }]
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
return result.should.equal(true)
|
||||
})
|
||||
|
||||
it('should return false when comparing different orchard docs', function() {
|
||||
it('should return false when comparing different orchard docs', function () {
|
||||
const lines1 = [{ text: 'goodbye world' }]
|
||||
const lines2 = [{ text: 'hello world' }]
|
||||
const result = this.comparitor.areSame(lines1, lines2)
|
||||
|
||||
Reference in New Issue
Block a user