Move old tests over to new jest format

pull/2914/head
Andrew Watkins 2018-03-05 07:37:46 -08:00
parent ffc976ec69
commit d2cddc4816
3 changed files with 21 additions and 23 deletions

View File

@ -17,8 +17,6 @@ const labels = ['time', 'test.label']
const div = document.createElement('div')
const graph = new Dygraph(div, timeSeries, {labels})
const oneHourMs = '3600000'
const a1 = {
group: '',
name: 'a1',
@ -43,14 +41,14 @@ describe('Shared.Annotations.Helpers', () => {
const actual = visibleAnnotations(undefined, annotations)
const expected = []
expect(actual).to.deep.equal(expected)
expect(actual).toEqual(expected)
})
it('returns an annotation if it is in the time range', () => {
const actual = visibleAnnotations(graph, annotations)
const expected = annotations
expect(actual).to.deep.equal(expected)
expect(actual).toEqual(expected)
})
it('removes an annotation if it is out of the time range', () => {
@ -65,7 +63,7 @@ describe('Shared.Annotations.Helpers', () => {
const actual = visibleAnnotations(graph, newAnnos)
const expected = annotations
expect(actual).to.deep.equal(expected)
expect(actual).toEqual(expected)
})
describe('with a duration', () => {
@ -79,7 +77,7 @@ describe('Shared.Annotations.Helpers', () => {
}
const expected = [...withDurations, expectedAnnotation]
expect(actual).to.deep.equal(expected)
expect(actual).toEqual(expected)
})
it('does not add a duration annotation if it is out of bounds', () => {
@ -96,7 +94,7 @@ describe('Shared.Annotations.Helpers', () => {
const actual = visibleAnnotations(graph, withDurations)
const expected = withDurations
expect(actual).to.deep.equal(expected)
expect(actual).toEqual(expected)
})
})
})

View File

@ -30,12 +30,12 @@ const state = {
annotations: [],
}
describe.only('Shared.Reducers.annotations', () => {
describe('Shared.Reducers.annotations', () => {
it('can load the annotations', () => {
const expected = [{time: '0', duration: ''}]
const actual = reducer(state, loadAnnotations(expected))
expect(actual.annotations).to.deep.equal(expected)
expect(actual.annotations).toEqual(expected)
})
it('can update an annotation', () => {
@ -45,7 +45,7 @@ describe.only('Shared.Reducers.annotations', () => {
updateAnnotation(expected[0])
)
expect(actual.annotations).to.deep.equal(expected)
expect(actual.annotations).toEqual(expected)
})
it('can delete an annotation', () => {
@ -55,13 +55,13 @@ describe.only('Shared.Reducers.annotations', () => {
deleteAnnotation(a1)
)
expect(actual.annotations).to.deep.equal(expected)
expect(actual.annotations).toEqual(expected)
})
it('can add an annotation', () => {
const expected = [a1]
const actual = reducer(state, addAnnotation(a1))
expect(actual.annotations).to.deep.equal(expected)
expect(actual.annotations).toEqual(expected)
})
})

View File

@ -54,31 +54,31 @@ describe('Dashboards.Reducers.cellEditorOverlay', () => {
singleStatType: defaultSingleStatType,
}
expect(actual.cell).to.equal(expected.cell)
expect(actual.gaugeColors).to.equal(expected.gaugeColors)
expect(actual.singleStatColors).to.equal(expected.singleStatColors)
expect(actual.singleStatType).to.equal(expected.singleStatType)
expect(actual.cell).toBe(expected.cell)
expect(actual.gaugeColors).toBe(expected.gaugeColors)
expect(actual.singleStatColors).toBe(expected.singleStatColors)
expect(actual.singleStatType).toBe(expected.singleStatType)
})
it('should hide cell editor overlay', () => {
const actual = reducer(initialState, hideCellEditorOverlay)
const expected = null
expect(actual.cell).to.equal(expected)
expect(actual.cell).toBe(expected)
})
it('should change the cell editor visualization type', () => {
const actual = reducer(initialState, changeCellType(defaultCellType))
const expected = defaultCellType
expect(actual.cell.type).to.equal(expected)
expect(actual.cell.type).toBe(expected)
})
it('should change the name of the cell', () => {
const actual = reducer(initialState, renameCell(defaultCellName))
const expected = defaultCellName
expect(actual.cell.name).to.equal(expected)
expect(actual.cell.name).toBe(expected)
})
it('should update the cell single stat colors', () => {
@ -88,7 +88,7 @@ describe('Dashboards.Reducers.cellEditorOverlay', () => {
)
const expected = defaultSingleStatColors
expect(actual.singleStatColors).to.equal(expected)
expect(actual.singleStatColors).toBe(expected)
})
it('should toggle the single stat type', () => {
@ -98,20 +98,20 @@ describe('Dashboards.Reducers.cellEditorOverlay', () => {
)
const expected = defaultSingleStatType
expect(actual.singleStatType).to.equal(expected)
expect(actual.singleStatType).toBe(expected)
})
it('should update the cell gauge colors', () => {
const actual = reducer(initialState, updateGaugeColors(defaultGaugeColors))
const expected = defaultGaugeColors
expect(actual.gaugeColors).to.equal(expected)
expect(actual.gaugeColors).toBe(expected)
})
it('should update the cell axes', () => {
const actual = reducer(initialState, updateAxes(defaultCellAxes))
const expected = defaultCellAxes
expect(actual.cell.axes).to.equal(expected)
expect(actual.cell.axes).toBe(expected)
})
})