mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
prettier 4 tabwidth
This commit is contained in:
parent
00ec614f1d
commit
96b413a365
42 changed files with 7034 additions and 6905 deletions
|
@ -4,45 +4,45 @@ import { Subject, Question } from '../types/basicTypes'
|
|||
const question: Question = createQuestion('asd', 'asd', { type: 'simple' })
|
||||
|
||||
test('Adds questions to empty db', () => {
|
||||
const emptyDb: Subject[] = []
|
||||
addQuestion(emptyDb, 'test subject', question)
|
||||
expect(emptyDb.length).toBe(1)
|
||||
const emptyDb: Subject[] = []
|
||||
addQuestion(emptyDb, 'test subject', question)
|
||||
expect(emptyDb.length).toBe(1)
|
||||
})
|
||||
|
||||
test('Adds questions next to existing', () => {
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'another something', question)
|
||||
expect(db.length).toBe(2)
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'another something', question)
|
||||
expect(db.length).toBe(2)
|
||||
})
|
||||
|
||||
test('Does not add new subject, multiple new questions', () => {
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
expect(db.length).toBe(1)
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
addQuestion(db, 'test subject', question)
|
||||
expect(db.length).toBe(1)
|
||||
})
|
||||
|
||||
test('Adds new subjects, multiple new questions', () => {
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'gfjdkglfd', question)
|
||||
addQuestion(db, ' somrthing test ', question)
|
||||
addQuestion(db, 'aaaaaaaa', question)
|
||||
expect(db.length).toBe(4)
|
||||
const db: Subject[] = [
|
||||
{
|
||||
Name: 'test subject',
|
||||
Questions: [question],
|
||||
},
|
||||
]
|
||||
addQuestion(db, 'gfjdkglfd', question)
|
||||
addQuestion(db, ' somrthing test ', question)
|
||||
addQuestion(db, 'aaaaaaaa', question)
|
||||
expect(db.length).toBe(4)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue