Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions app/helpers/validate/teachers.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const assert = require('assert')

const teachers = require('./teachers')

describe('teachers', function () {
it('should return empty list when has not errors', function () {
const disciplinas = [
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 6 spaces but found 8.

Suggested change
{
{

teoria: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 8 spaces but found 12.

Suggested change
teoria: {
teoria: {

name: 'Vanessa Kruth',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 10 spaces but found 16.

Suggested change
name: 'Vanessa Kruth',
name: 'Vanessa Kruth',

error: null,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 10 spaces but found 16.

Suggested change
error: null,
error: null,

},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 8 spaces but found 12.

Suggested change
},
},

pratica: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 8 spaces but found 12.

Suggested change
pratica: {
pratica: {

name: 'Vanessa Kruth',
error: null,
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 8 spaces but found 12.

Suggested change
}
}

},
{
teoria: {
name: 'Isidro',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 10 spaces but found 16.

Suggested change
name: 'Isidro',
name: 'Isidro',

error: null,
},
pratica: {
name: 'Isidro',
error: null,
}
},
];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Extra semicolon.

Suggested change
];
]


assert.equal(0, Array.from(teachers(disciplinas)).length)
})

it('should return list with one error', function () {
const disciplinas = [
{
teoria: {
name: 'Vanessa Kruth',
error: null,
},
pratica: {
name: 'Vanessa Kruth',
error: null,
}
},
{
teoria: {
name: 'Isidro',
error: 'Sala não encontrada',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy has a fix for the issue: Expected indentation of 10 spaces but found 16.

Suggested change
error: 'Sala não encontrada',
error: 'Sala não encontrada',

},
pratica: {
name: 'Isidro',
error: null,
}
},
];

assert.equal(1, Array.from(teachers(disciplinas)).length)
})
})