diff --git a/ui/spec/shared/annotations/helpersSpec.js b/ui/test/annotations/helpersSpec.js similarity index 90% rename from ui/spec/shared/annotations/helpersSpec.js rename to ui/test/annotations/helpersSpec.js index 37e55f411..bacf8d062 100644 --- a/ui/spec/shared/annotations/helpersSpec.js +++ b/ui/test/annotations/helpersSpec.js @@ -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) }) }) }) diff --git a/ui/spec/shared/reducers/annotationsSpec.js b/ui/test/annotations/reducers/annotations.test.js similarity index 80% rename from ui/spec/shared/reducers/annotationsSpec.js rename to ui/test/annotations/reducers/annotations.test.js index 54a6f3c9d..fb7cddffd 100644 --- a/ui/spec/shared/reducers/annotationsSpec.js +++ b/ui/test/annotations/reducers/annotations.test.js @@ -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) }) }) diff --git a/ui/spec/dashboards/reducers/cellEditorOverlaySpec.js b/ui/test/dashboards/reducers/cellEditorOverlay.test.js similarity index 81% rename from ui/spec/dashboards/reducers/cellEditorOverlaySpec.js rename to ui/test/dashboards/reducers/cellEditorOverlay.test.js index 21004e132..1cdd137e7 100644 --- a/ui/spec/dashboards/reducers/cellEditorOverlaySpec.js +++ b/ui/test/dashboards/reducers/cellEditorOverlay.test.js @@ -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) }) })