diff options
Diffstat (limited to 'spec/javascripts')
39 files changed, 1057 insertions, 7931 deletions
diff --git a/spec/javascripts/activities_spec.js b/spec/javascripts/activities_spec.js deleted file mode 100644 index 23b6de7e4e0..00000000000 --- a/spec/javascripts/activities_spec.js +++ /dev/null @@ -1,71 +0,0 @@ -/* eslint-disable no-unused-expressions, no-prototype-builtins, no-new, no-shadow */ - -import $ from 'jquery'; -import 'vendor/jquery.endless-scroll'; -import Activities from '~/activities'; -import Pager from '~/pager'; - -describe('Activities', () => { - window.gon || (window.gon = {}); - const fixtureTemplate = 'static/event_filter.html'; - const filters = [ - { - id: 'all', - }, - { - id: 'push', - name: 'push events', - }, - { - id: 'merged', - name: 'merge events', - }, - { - id: 'comments', - }, - { - id: 'team', - }, - ]; - - function getEventName(index) { - const filter = filters[index]; - return filter.hasOwnProperty('name') ? filter.name : filter.id; - } - - function getSelector(index) { - const filter = filters[index]; - return `#${filter.id}_event_filter`; - } - - beforeEach(() => { - loadFixtures(fixtureTemplate); - spyOn(Pager, 'init').and.stub(); - new Activities(); - }); - - for (let i = 0; i < filters.length; i += 1) { - (i => { - describe(`when selecting ${getEventName(i)}`, () => { - beforeEach(() => { - $(getSelector(i)).click(); - }); - - for (let x = 0; x < filters.length; x += 1) { - (x => { - const shouldHighlight = i === x; - const testName = shouldHighlight ? 'should highlight' : 'should not highlight'; - - it(`${testName} ${getEventName(x)}`, () => { - expect( - $(getSelector(x)) - .parent() - .hasClass('active'), - ).toEqual(shouldHighlight); - }); - })(x); - } - }); - })(i); - } -}); diff --git a/spec/javascripts/api_spec.js b/spec/javascripts/api_spec.js deleted file mode 100644 index 805bb10bda6..00000000000 --- a/spec/javascripts/api_spec.js +++ /dev/null @@ -1,477 +0,0 @@ -import MockAdapter from 'axios-mock-adapter'; -import axios from '~/lib/utils/axios_utils'; -import Api from '~/api'; - -describe('Api', () => { - const dummyApiVersion = 'v3000'; - const dummyUrlRoot = '/gitlab'; - const dummyGon = { - api_version: dummyApiVersion, - relative_url_root: dummyUrlRoot, - }; - let originalGon; - let mock; - - beforeEach(() => { - mock = new MockAdapter(axios); - originalGon = window.gon; - window.gon = Object.assign({}, dummyGon); - }); - - afterEach(() => { - mock.restore(); - window.gon = originalGon; - }); - - describe('buildUrl', () => { - it('adds URL root and fills in API version', () => { - const input = '/api/:version/foo/bar'; - const expectedOutput = `${dummyUrlRoot}/api/${dummyApiVersion}/foo/bar`; - - const builtUrl = Api.buildUrl(input); - - expect(builtUrl).toEqual(expectedOutput); - }); - - [null, '', '/'].forEach(root => { - it(`works when relative_url_root is ${root}`, () => { - window.gon.relative_url_root = root; - const input = '/api/:version/foo/bar'; - const expectedOutput = `/api/${dummyApiVersion}/foo/bar`; - - const builtUrl = Api.buildUrl(input); - - expect(builtUrl).toEqual(expectedOutput); - }); - }); - }); - - describe('group', () => { - it('fetches a group', done => { - const groupId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}`; - mock.onGet(expectedUrl).reply(200, { - name: 'test', - }); - - Api.group(groupId, response => { - expect(response.name).toBe('test'); - done(); - }); - }); - }); - - describe('groupMembers', () => { - it('fetches group members', done => { - const groupId = '54321'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/members`; - const expectedData = [{ id: 7 }]; - mock.onGet(expectedUrl).reply(200, expectedData); - - Api.groupMembers(groupId) - .then(({ data }) => { - expect(data).toEqual(expectedData); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('groups', () => { - it('fetches groups', done => { - const query = 'dummy query'; - const options = { unused: 'option' }; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups.json`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.groups(query, options, response => { - expect(response.length).toBe(1); - expect(response[0].name).toBe('test'); - done(); - }); - }); - }); - - describe('namespaces', () => { - it('fetches namespaces', done => { - const query = 'dummy query'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/namespaces.json`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.namespaces(query, response => { - expect(response.length).toBe(1); - expect(response[0].name).toBe('test'); - done(); - }); - }); - }); - - describe('projects', () => { - it('fetches projects with membership when logged in', done => { - const query = 'dummy query'; - const options = { unused: 'option' }; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects.json`; - window.gon.current_user_id = 1; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.projects(query, options, response => { - expect(response.length).toBe(1); - expect(response[0].name).toBe('test'); - done(); - }); - }); - - it('fetches projects without membership when not logged in', done => { - const query = 'dummy query'; - const options = { unused: 'option' }; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects.json`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.projects(query, options, response => { - expect(response.length).toBe(1); - expect(response[0].name).toBe('test'); - done(); - }); - }); - }); - - describe('projectMergeRequests', () => { - const projectPath = 'abc'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/merge_requests`; - - it('fetches all merge requests for a project', done => { - const mockData = [{ source_branch: 'foo' }, { source_branch: 'bar' }]; - mock.onGet(expectedUrl).reply(200, mockData); - Api.projectMergeRequests(projectPath) - .then(({ data }) => { - expect(data.length).toEqual(2); - expect(data[0].source_branch).toBe('foo'); - expect(data[1].source_branch).toBe('bar'); - }) - .then(done) - .catch(done.fail); - }); - - it('fetches merge requests filtered with passed params', done => { - const params = { - source_branch: 'bar', - }; - const mockData = [{ source_branch: 'bar' }]; - mock.onGet(expectedUrl, { params }).reply(200, mockData); - - Api.projectMergeRequests(projectPath, params) - .then(({ data }) => { - expect(data.length).toEqual(1); - expect(data[0].source_branch).toBe('bar'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('projectMergeRequest', () => { - it('fetches a merge request', done => { - const projectPath = 'abc'; - const mergeRequestId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/merge_requests/${mergeRequestId}`; - mock.onGet(expectedUrl).reply(200, { - title: 'test', - }); - - Api.projectMergeRequest(projectPath, mergeRequestId) - .then(({ data }) => { - expect(data.title).toBe('test'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('projectMergeRequestChanges', () => { - it('fetches the changes of a merge request', done => { - const projectPath = 'abc'; - const mergeRequestId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/merge_requests/${mergeRequestId}/changes`; - mock.onGet(expectedUrl).reply(200, { - title: 'test', - }); - - Api.projectMergeRequestChanges(projectPath, mergeRequestId) - .then(({ data }) => { - expect(data.title).toBe('test'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('projectMergeRequestVersions', () => { - it('fetches the versions of a merge request', done => { - const projectPath = 'abc'; - const mergeRequestId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/merge_requests/${mergeRequestId}/versions`; - mock.onGet(expectedUrl).reply(200, [ - { - id: 123, - }, - ]); - - Api.projectMergeRequestVersions(projectPath, mergeRequestId) - .then(({ data }) => { - expect(data.length).toBe(1); - expect(data[0].id).toBe(123); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('projectRunners', () => { - it('fetches the runners of a project', done => { - const projectPath = 7; - const params = { scope: 'active' }; - const mockData = [{ id: 4 }]; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectPath}/runners`; - mock.onGet(expectedUrl, { params }).reply(200, mockData); - - Api.projectRunners(projectPath, { params }) - .then(({ data }) => { - expect(data).toEqual(mockData); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('newLabel', () => { - it('creates a new label', done => { - const namespace = 'some namespace'; - const project = 'some project'; - const labelData = { some: 'data' }; - const expectedUrl = `${dummyUrlRoot}/${namespace}/${project}/labels`; - const expectedData = { - label: labelData, - }; - mock.onPost(expectedUrl).reply(config => { - expect(config.data).toBe(JSON.stringify(expectedData)); - - return [ - 200, - { - name: 'test', - }, - ]; - }); - - Api.newLabel(namespace, project, labelData, response => { - expect(response.name).toBe('test'); - done(); - }); - }); - - it('creates a group label', done => { - const namespace = 'group/subgroup'; - const labelData = { some: 'data' }; - const expectedUrl = Api.buildUrl(Api.groupLabelsPath).replace(':namespace_path', namespace); - const expectedData = { - label: labelData, - }; - mock.onPost(expectedUrl).reply(config => { - expect(config.data).toBe(JSON.stringify(expectedData)); - - return [ - 200, - { - name: 'test', - }, - ]; - }); - - Api.newLabel(namespace, undefined, labelData, response => { - expect(response.name).toBe('test'); - done(); - }); - }); - }); - - describe('groupProjects', () => { - it('fetches group projects', done => { - const groupId = '123456'; - const query = 'dummy query'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/projects.json`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.groupProjects(groupId, query, {}, response => { - expect(response.length).toBe(1); - expect(response[0].name).toBe('test'); - done(); - }); - }); - }); - - describe('issueTemplate', () => { - it('fetches an issue template', done => { - const namespace = 'some namespace'; - const project = 'some project'; - const templateKey = ' template #%?.key '; - const templateType = 'template type'; - const expectedUrl = `${dummyUrlRoot}/${namespace}/${project}/templates/${templateType}/${encodeURIComponent( - templateKey, - )}`; - mock.onGet(expectedUrl).reply(200, 'test'); - - Api.issueTemplate(namespace, project, templateKey, templateType, (error, response) => { - expect(response).toBe('test'); - done(); - }); - }); - }); - - describe('projectTemplates', () => { - it('fetches a list of templates', done => { - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/gitlab-org%2Fgitlab-ce/templates/licenses`; - - mock.onGet(expectedUrl).reply(200, 'test'); - - Api.projectTemplates('gitlab-org/gitlab-ce', 'licenses', {}, response => { - expect(response).toBe('test'); - done(); - }); - }); - }); - - describe('projectTemplate', () => { - it('fetches a single template', done => { - const data = { unused: 'option' }; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/gitlab-org%2Fgitlab-ce/templates/licenses/test%20license`; - - mock.onGet(expectedUrl).reply(200, 'test'); - - Api.projectTemplate('gitlab-org/gitlab-ce', 'licenses', 'test license', data, response => { - expect(response).toBe('test'); - done(); - }); - }); - }); - - describe('users', () => { - it('fetches users', done => { - const query = 'dummy query'; - const options = { unused: 'option' }; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/users.json`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.users(query, options) - .then(({ data }) => { - expect(data.length).toBe(1); - expect(data[0].name).toBe('test'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('user', () => { - it('fetches single user', done => { - const userId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/users/${userId}`; - mock.onGet(expectedUrl).reply(200, { - name: 'testuser', - }); - - Api.user(userId) - .then(({ data }) => { - expect(data.name).toBe('testuser'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('user status', () => { - it('fetches single user status', done => { - const userId = '123456'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/users/${userId}/status`; - mock.onGet(expectedUrl).reply(200, { - message: 'testmessage', - }); - - Api.userStatus(userId) - .then(({ data }) => { - expect(data.message).toBe('testmessage'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('commitPipelines', () => { - it('fetches pipelines for a given commit', done => { - const projectId = 'example/foobar'; - const commitSha = 'abc123def'; - const expectedUrl = `${dummyUrlRoot}/${projectId}/commit/${commitSha}/pipelines`; - mock.onGet(expectedUrl).reply(200, [ - { - name: 'test', - }, - ]); - - Api.commitPipelines(projectId, commitSha) - .then(({ data }) => { - expect(data.length).toBe(1); - expect(data[0].name).toBe('test'); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('createBranch', () => { - it('creates new branch', done => { - const ref = 'master'; - const branch = 'new-branch-name'; - const dummyProjectPath = 'gitlab-org/gitlab-ce'; - const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${encodeURIComponent( - dummyProjectPath, - )}/repository/branches`; - - spyOn(axios, 'post').and.callThrough(); - - mock.onPost(expectedUrl).replyOnce(200, { - name: branch, - }); - - Api.createBranch(dummyProjectPath, { ref, branch }) - .then(({ data }) => { - expect(data.name).toBe(branch); - expect(axios.post).toHaveBeenCalledWith(expectedUrl, { ref, branch }); - }) - .then(done) - .catch(done.fail); - }); - }); -}); diff --git a/spec/javascripts/autosave_spec.js b/spec/javascripts/autosave_spec.js deleted file mode 100644 index dcb1c781591..00000000000 --- a/spec/javascripts/autosave_spec.js +++ /dev/null @@ -1,154 +0,0 @@ -import $ from 'jquery'; -import Autosave from '~/autosave'; -import AccessorUtilities from '~/lib/utils/accessor'; - -describe('Autosave', () => { - let autosave; - const field = $('<textarea></textarea>'); - const key = 'key'; - - describe('class constructor', () => { - beforeEach(() => { - spyOn(AccessorUtilities, 'isLocalStorageAccessSafe').and.returnValue(true); - spyOn(Autosave.prototype, 'restore'); - }); - - it('should set .isLocalStorageAvailable', () => { - autosave = new Autosave(field, key); - - expect(AccessorUtilities.isLocalStorageAccessSafe).toHaveBeenCalled(); - expect(autosave.isLocalStorageAvailable).toBe(true); - }); - }); - - describe('restore', () => { - beforeEach(() => { - autosave = { - field, - key, - }; - - spyOn(window.localStorage, 'getItem'); - }); - - describe('if .isLocalStorageAvailable is `false`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = false; - - Autosave.prototype.restore.call(autosave); - }); - - it('should not call .getItem', () => { - expect(window.localStorage.getItem).not.toHaveBeenCalled(); - }); - }); - - describe('if .isLocalStorageAvailable is `true`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = true; - }); - - it('should call .getItem', () => { - Autosave.prototype.restore.call(autosave); - - expect(window.localStorage.getItem).toHaveBeenCalledWith(key); - }); - - it('triggers jquery event', () => { - spyOn(autosave.field, 'trigger').and.callThrough(); - - Autosave.prototype.restore.call(autosave); - - expect(field.trigger).toHaveBeenCalled(); - }); - - it('triggers native event', done => { - autosave.field.get(0).addEventListener('change', () => { - done(); - }); - - Autosave.prototype.restore.call(autosave); - }); - }); - - describe('if field gets deleted from DOM', () => { - beforeEach(() => { - autosave.field = $('.not-a-real-element'); - }); - - it('does not trigger event', () => { - spyOn(field, 'trigger').and.callThrough(); - - expect(field.trigger).not.toHaveBeenCalled(); - }); - }); - }); - - describe('save', () => { - beforeEach(() => { - autosave = jasmine.createSpyObj('autosave', ['reset']); - autosave.field = field; - field.val('value'); - - spyOn(window.localStorage, 'setItem'); - }); - - describe('if .isLocalStorageAvailable is `false`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = false; - - Autosave.prototype.save.call(autosave); - }); - - it('should not call .setItem', () => { - expect(window.localStorage.setItem).not.toHaveBeenCalled(); - }); - }); - - describe('if .isLocalStorageAvailable is `true`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = true; - - Autosave.prototype.save.call(autosave); - }); - - it('should call .setItem', () => { - expect(window.localStorage.setItem).toHaveBeenCalled(); - }); - }); - }); - - describe('reset', () => { - beforeEach(() => { - autosave = { - key, - }; - - spyOn(window.localStorage, 'removeItem'); - }); - - describe('if .isLocalStorageAvailable is `false`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = false; - - Autosave.prototype.reset.call(autosave); - }); - - it('should not call .removeItem', () => { - expect(window.localStorage.removeItem).not.toHaveBeenCalled(); - }); - }); - - describe('if .isLocalStorageAvailable is `true`', () => { - beforeEach(() => { - autosave.isLocalStorageAvailable = true; - - Autosave.prototype.reset.call(autosave); - }); - - it('should call .removeItem', () => { - expect(window.localStorage.removeItem).toHaveBeenCalledWith(key); - }); - }); - }); -}); diff --git a/spec/javascripts/boards/boards_store_spec.js b/spec/javascripts/boards/boards_store_spec.js index 22f192bc7f3..68e66346bfd 100644 --- a/spec/javascripts/boards/boards_store_spec.js +++ b/spec/javascripts/boards/boards_store_spec.js @@ -12,6 +12,7 @@ import '~/boards/models/issue'; import '~/boards/models/list'; import '~/boards/services/board_service'; import boardsStore from '~/boards/stores/boards_store'; +import eventHub from '~/boards/eventhub'; import { listObj, listObjDuplicate, boardsMockInterceptor, mockBoardService } from './mock_data'; describe('Store', () => { @@ -44,6 +45,48 @@ describe('Store', () => { expect(boardsStore.state.lists.length).toBe(0); }); + describe('addList', () => { + it('sorts by position', () => { + boardsStore.addList({ position: 2 }); + boardsStore.addList({ position: 1 }); + + expect(boardsStore.state.lists[0].position).toBe(1); + }); + }); + + describe('toggleFilter', () => { + const dummyFilter = 'x=42'; + let updateTokensSpy; + + beforeEach(() => { + updateTokensSpy = jasmine.createSpy('updateTokens'); + eventHub.$once('updateTokens', updateTokensSpy); + + // prevent using window.history + spyOn(boardsStore, 'updateFiltersUrl').and.callFake(() => {}); + }); + + it('adds the filter if it is not present', () => { + boardsStore.filter.path = 'something'; + + boardsStore.toggleFilter(dummyFilter); + + expect(boardsStore.filter.path).toEqual(`something&${dummyFilter}`); + expect(updateTokensSpy).toHaveBeenCalled(); + expect(boardsStore.updateFiltersUrl).toHaveBeenCalled(); + }); + + it('removes the filter if it is present', () => { + boardsStore.filter.path = `something&${dummyFilter}`; + + boardsStore.toggleFilter(dummyFilter); + + expect(boardsStore.filter.path).toEqual('something'); + expect(updateTokensSpy).toHaveBeenCalled(); + expect(boardsStore.updateFiltersUrl).toHaveBeenCalled(); + }); + }); + describe('lists', () => { it('creates new list without persisting to DB', () => { boardsStore.addList(listObj); @@ -268,4 +311,37 @@ describe('Store', () => { }); }); }); + + describe('clearDetailIssue', () => { + it('resets issue details', () => { + boardsStore.detail.issue = 'something'; + + boardsStore.clearDetailIssue(); + + expect(boardsStore.detail.issue).toEqual({}); + }); + }); + + describe('setIssueDetail', () => { + it('sets issue details', () => { + boardsStore.detail.issue = 'some details'; + + const dummyValue = 'new details'; + boardsStore.setIssueDetail(dummyValue); + + expect(boardsStore.detail.issue).toEqual(dummyValue); + }); + }); + + describe('startMoving', () => { + it('stores list and issue', () => { + const dummyIssue = 'some issue'; + const dummyList = 'some list'; + + boardsStore.startMoving(dummyList, dummyIssue); + + expect(boardsStore.moving.issue).toEqual(dummyIssue); + expect(boardsStore.moving.list).toEqual(dummyList); + }); + }); }); diff --git a/spec/javascripts/boards/mock_data.js b/spec/javascripts/boards/mock_data.js index 93a0f29af0a..9854cf49e97 100644 --- a/spec/javascripts/boards/mock_data.js +++ b/spec/javascripts/boards/mock_data.js @@ -47,7 +47,7 @@ export const BoardsMockData = { }, ], }, - '/test/issue-boards/milestones.json': [ + '/test/issue-boards/-/milestones.json': [ { id: 1, title: 'test', @@ -58,10 +58,10 @@ export const BoardsMockData = { '/test/-/boards/1/lists': listObj, }, PUT: { - '/test/issue-boards/board/1/lists{/id}': {}, + '/test/issue-boards/-/board/1/lists{/id}': {}, }, DELETE: { - '/test/issue-boards/board/1/lists{/id}': {}, + '/test/issue-boards/-/board/1/lists{/id}': {}, }, }; @@ -71,7 +71,7 @@ export const boardsMockInterceptor = config => { }; export const mockBoardService = (opts = {}) => { - const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/boards.json'; + const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/-/boards.json'; const listsEndpoint = opts.listsEndpoint || '/test/-/boards/1/lists'; const bulkUpdatePath = opts.bulkUpdatePath || ''; const boardId = opts.boardId || '1'; diff --git a/spec/javascripts/diffs/components/commit_item_spec.js b/spec/javascripts/diffs/components/commit_item_spec.js index 8fc9b10dd0b..cfe0c4bad71 100644 --- a/spec/javascripts/diffs/components/commit_item_spec.js +++ b/spec/javascripts/diffs/components/commit_item_spec.js @@ -8,7 +8,7 @@ import getDiffWithCommit from '../mock_data/diff_with_commit'; const TEST_AUTHOR_NAME = 'test'; const TEST_AUTHOR_EMAIL = 'test+test@gitlab.com'; -const TEST_AUTHOR_GRAVATAR = `${TEST_HOST}/avatar/test?s=36`; +const TEST_AUTHOR_GRAVATAR = `${TEST_HOST}/avatar/test?s=40`; const TEST_SIGNATURE_HTML = '<a>Legit commit</a>'; const TEST_PIPELINE_STATUS_PATH = `${TEST_HOST}/pipeline/status`; @@ -65,7 +65,7 @@ describe('diffs/components/commit_item', () => { const imgElement = avatarElement.querySelector('img'); expect(avatarElement).toHaveAttr('href', commit.author.web_url); - expect(imgElement).toHaveClass('s36'); + expect(imgElement).toHaveClass('s40'); expect(imgElement).toHaveAttr('alt', commit.author.name); expect(imgElement).toHaveAttr('src', commit.author.avatar_url); }); diff --git a/spec/javascripts/helpers/vue_test_utils_helper.js b/spec/javascripts/helpers/vue_test_utils_helper.js index 19e27388eeb..121e99c9783 100644 --- a/spec/javascripts/helpers/vue_test_utils_helper.js +++ b/spec/javascripts/helpers/vue_test_utils_helper.js @@ -16,4 +16,6 @@ const vNodeContainsText = (vnode, text) => * @param {String} text */ export const shallowWrapperContainsSlotText = (shallowWrapper, slotName, text) => - !!shallowWrapper.vm.$slots[slotName].filter(vnode => vNodeContainsText(vnode, text)).length; + Boolean( + shallowWrapper.vm.$slots[slotName].filter(vnode => vNodeContainsText(vnode, text)).length, + ); diff --git a/spec/javascripts/ide/components/ide_spec.js b/spec/javascripts/ide/components/ide_spec.js index dc5790f6562..de4becec1cd 100644 --- a/spec/javascripts/ide/components/ide_spec.js +++ b/spec/javascripts/ide/components/ide_spec.js @@ -5,21 +5,53 @@ import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helpe import { file, resetStore } from '../helpers'; import { projectData } from '../mock_data'; -describe('ide component', () => { +function bootstrap(projData) { + const Component = Vue.extend(ide); + + store.state.currentProjectId = 'abcproject'; + store.state.currentBranchId = 'master'; + store.state.projects.abcproject = Object.assign({}, projData); + Vue.set(store.state.trees, 'abcproject/master', { + tree: [], + loading: false, + }); + + return createComponentWithStore(Component, store, { + emptyStateSvgPath: 'svg', + noChangesStateSvgPath: 'svg', + committedStateSvgPath: 'svg', + }); +} + +describe('ide component, empty repo', () => { let vm; beforeEach(() => { - const Component = Vue.extend(ide); + const emptyProjData = Object.assign({}, projectData, { empty_repo: true, branches: {} }); + vm = bootstrap(emptyProjData); + vm.$mount(); + }); - store.state.currentProjectId = 'abcproject'; - store.state.currentBranchId = 'master'; - store.state.projects.abcproject = Object.assign({}, projectData); + afterEach(() => { + vm.$destroy(); + + resetStore(vm.$store); + }); - vm = createComponentWithStore(Component, store, { - emptyStateSvgPath: 'svg', - noChangesStateSvgPath: 'svg', - committedStateSvgPath: 'svg', - }).$mount(); + it('renders "New file" button in empty repo', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).not.toBeNull(); + done(); + }); + }); +}); + +describe('ide component, non-empty repo', () => { + let vm; + + beforeEach(() => { + vm = bootstrap(projectData); + vm.$mount(); }); afterEach(() => { @@ -28,17 +60,15 @@ describe('ide component', () => { resetStore(vm.$store); }); - it('does not render right when no files open', () => { - expect(vm.$el.querySelector('.panel-right')).toBeNull(); - }); + it('shows error message when set', done => { + expect(vm.$el.querySelector('.flash-container')).toBe(null); - it('renders right panel when files are open', done => { - vm.$store.state.trees['abcproject/mybranch'] = { - tree: [file()], + vm.$store.state.errorMessage = { + text: 'error', }; - Vue.nextTick(() => { - expect(vm.$el.querySelector('.panel-right')).toBeNull(); + vm.$nextTick(() => { + expect(vm.$el.querySelector('.flash-container')).not.toBe(null); done(); }); @@ -71,17 +101,25 @@ describe('ide component', () => { }); }); - it('shows error message when set', done => { - expect(vm.$el.querySelector('.flash-container')).toBe(null); - - vm.$store.state.errorMessage = { - text: 'error', - }; + describe('non-existent branch', () => { + it('does not render "New file" button for non-existent branch when repo is not empty', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); + done(); + }); + }); + }); - vm.$nextTick(() => { - expect(vm.$el.querySelector('.flash-container')).not.toBe(null); + describe('branch with files', () => { + beforeEach(() => { + store.state.trees['abcproject/master'].tree = [file()]; + }); - done(); + it('does not render "New file" button', done => { + vm.$nextTick(() => { + expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); + done(); + }); }); }); }); diff --git a/spec/javascripts/ide/components/ide_tree_list_spec.js b/spec/javascripts/ide/components/ide_tree_list_spec.js index 4ecbdb8a55e..f63007c7dd2 100644 --- a/spec/javascripts/ide/components/ide_tree_list_spec.js +++ b/spec/javascripts/ide/components/ide_tree_list_spec.js @@ -7,25 +7,23 @@ import { projectData } from '../mock_data'; describe('IDE tree list', () => { const Component = Vue.extend(IdeTreeList); + const normalBranchTree = [file('fileName')]; + const emptyBranchTree = []; let vm; - beforeEach(() => { + const bootstrapWithTree = (tree = normalBranchTree) => { store.state.currentProjectId = 'abcproject'; store.state.currentBranchId = 'master'; store.state.projects.abcproject = Object.assign({}, projectData); Vue.set(store.state.trees, 'abcproject/master', { - tree: [file('fileName')], + tree, loading: false, }); vm = createComponentWithStore(Component, store, { viewerType: 'edit', }); - - spyOn(vm, 'updateViewer').and.callThrough(); - - vm.$mount(); - }); + }; afterEach(() => { vm.$destroy(); @@ -33,22 +31,47 @@ describe('IDE tree list', () => { resetStore(vm.$store); }); - it('updates viewer on mount', () => { - expect(vm.updateViewer).toHaveBeenCalledWith('edit'); - }); + describe('normal branch', () => { + beforeEach(() => { + bootstrapWithTree(); + + spyOn(vm, 'updateViewer').and.callThrough(); + + vm.$mount(); + }); + + it('updates viewer on mount', () => { + expect(vm.updateViewer).toHaveBeenCalledWith('edit'); + }); + + it('renders loading indicator', done => { + store.state.trees['abcproject/master'].loading = true; - it('renders loading indicator', done => { - store.state.trees['abcproject/master'].loading = true; + vm.$nextTick(() => { + expect(vm.$el.querySelector('.multi-file-loading-container')).not.toBeNull(); + expect(vm.$el.querySelectorAll('.multi-file-loading-container').length).toBe(3); - vm.$nextTick(() => { - expect(vm.$el.querySelector('.multi-file-loading-container')).not.toBeNull(); - expect(vm.$el.querySelectorAll('.multi-file-loading-container').length).toBe(3); + done(); + }); + }); - done(); + it('renders list of files', () => { + expect(vm.$el.textContent).toContain('fileName'); }); }); - it('renders list of files', () => { - expect(vm.$el.textContent).toContain('fileName'); + describe('empty-branch state', () => { + beforeEach(() => { + bootstrapWithTree(emptyBranchTree); + + spyOn(vm, 'updateViewer').and.callThrough(); + + vm.$mount(); + }); + + it('does not load files if the branch is empty', () => { + expect(vm.$el.textContent).not.toContain('fileName'); + expect(vm.$el.textContent).toContain('No files'); + }); }); }); diff --git a/spec/javascripts/ide/stores/actions/project_spec.js b/spec/javascripts/ide/stores/actions/project_spec.js index cd519eaed7c..8ecb6129c63 100644 --- a/spec/javascripts/ide/stores/actions/project_spec.js +++ b/spec/javascripts/ide/stores/actions/project_spec.js @@ -4,7 +4,7 @@ import { refreshLastCommitData, showBranchNotFoundError, createNewBranchFromDefault, - getBranchData, + showEmptyState, openBranch, } from '~/ide/stores/actions'; import store from '~/ide/stores'; @@ -196,39 +196,44 @@ describe('IDE store project actions', () => { }); }); - describe('getBranchData', () => { - describe('error', () => { - it('dispatches branch not found action when response is 404', done => { - const dispatch = jasmine.createSpy('dispatchSpy'); - - mock.onGet(/(.*)/).replyOnce(404); - - getBranchData( + describe('showEmptyState', () => { + it('commits proper mutations when supplied error is 404', done => { + testAction( + showEmptyState, + { + err: { + response: { + status: 404, + }, + }, + projectId: 'abc/def', + branchId: 'master', + }, + store.state, + [ { - commit() {}, - dispatch, - state: store.state, + type: 'CREATE_TREE', + payload: { + treePath: 'abc/def/master', + }, }, { - projectId: 'abc/def', - branchId: 'master-testing', + type: 'TOGGLE_LOADING', + payload: { + entry: store.state.trees['abc/def/master'], + forceValue: false, + }, }, - ) - .then(done.fail) - .catch(() => { - expect(dispatch.calls.argsFor(0)).toEqual([ - 'showBranchNotFoundError', - 'master-testing', - ]); - done(); - }); - }); + ], + [], + done, + ); }); }); describe('openBranch', () => { const branch = { - projectId: 'feature/lorem-ipsum', + projectId: 'abc/def', branchId: '123-lorem', }; @@ -238,63 +243,113 @@ describe('IDE store project actions', () => { 'foo/bar-pending': { pending: true }, 'foo/bar': { pending: false }, }; - - spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); }); - it('dispatches branch actions', done => { - openBranch(store, branch) - .then(() => { - expect(store.dispatch.calls.allArgs()).toEqual([ - ['setCurrentBranchId', branch.branchId], - ['getBranchData', branch], - ['getFiles', branch], - ['getMergeRequestsForBranch', branch], - ]); - }) - .then(done) - .catch(done.fail); - }); + describe('empty repo', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); - it('handles tree entry action, if basePath is given', done => { - openBranch(store, { ...branch, basePath: 'foo/bar/' }) - .then(() => { - expect(store.dispatch).toHaveBeenCalledWith( - 'handleTreeEntryAction', - store.state.entries['foo/bar'], - ); - }) - .then(done) - .catch(done.fail); + store.state.currentProjectId = 'abc/def'; + store.state.projects['abc/def'] = { + empty_repo: true, + }; + }); + + afterEach(() => { + resetStore(store); + }); + + it('dispatches showEmptyState action right away', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['showEmptyState', branch], + ]); + done(); + }) + .catch(done.fail); + }); }); - it('does not handle tree entry action, if entry is pending', done => { - openBranch(store, { ...branch, basePath: 'foo/bar-pending' }) - .then(() => { - expect(store.dispatch).not.toHaveBeenCalledWith( - 'handleTreeEntryAction', - jasmine.anything(), - ); - }) - .then(done) - .catch(done.fail); + describe('existing branch', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.resolve()); + }); + + it('dispatches branch actions', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['getBranchData', branch], + ['getMergeRequestsForBranch', branch], + ['getFiles', branch], + ]); + }) + .then(done) + .catch(done.fail); + }); + + it('handles tree entry action, if basePath is given', done => { + openBranch(store, { ...branch, basePath: 'foo/bar/' }) + .then(() => { + expect(store.dispatch).toHaveBeenCalledWith( + 'handleTreeEntryAction', + store.state.entries['foo/bar'], + ); + }) + .then(done) + .catch(done.fail); + }); + + it('does not handle tree entry action, if entry is pending', done => { + openBranch(store, { ...branch, basePath: 'foo/bar-pending' }) + .then(() => { + expect(store.dispatch).not.toHaveBeenCalledWith( + 'handleTreeEntryAction', + jasmine.anything(), + ); + }) + .then(done) + .catch(done.fail); + }); + + it('creates a new file supplied via URL if the file does not exist yet', done => { + openBranch(store, { ...branch, basePath: 'not-existent.md' }) + .then(() => { + expect(store.dispatch).not.toHaveBeenCalledWith( + 'handleTreeEntryAction', + jasmine.anything(), + ); + + expect(store.dispatch).toHaveBeenCalledWith('createTempEntry', { + name: 'not-existent.md', + type: 'blob', + }); + }) + .then(done) + .catch(done.fail); + }); }); - it('creates a new file supplied via URL if the file does not exist yet', done => { - openBranch(store, { ...branch, basePath: 'not-existent.md' }) - .then(() => { - expect(store.dispatch).not.toHaveBeenCalledWith( - 'handleTreeEntryAction', - jasmine.anything(), - ); + describe('non-existent branch', () => { + beforeEach(() => { + spyOn(store, 'dispatch').and.returnValue(Promise.reject()); + }); - expect(store.dispatch).toHaveBeenCalledWith('createTempEntry', { - name: 'not-existent.md', - type: 'blob', - }); - }) - .then(done) - .catch(done.fail); + it('dispatches correct branch actions', done => { + openBranch(store, branch) + .then(() => { + expect(store.dispatch.calls.allArgs()).toEqual([ + ['setCurrentBranchId', branch.branchId], + ['getBranchData', branch], + ['showBranchNotFoundError', branch.branchId], + ]); + }) + .then(done) + .catch(done.fail); + }); }); }); }); diff --git a/spec/javascripts/ide/stores/actions/tree_spec.js b/spec/javascripts/ide/stores/actions/tree_spec.js index 5ed9b9003a7..674ecdc6764 100644 --- a/spec/javascripts/ide/stores/actions/tree_spec.js +++ b/spec/javascripts/ide/stores/actions/tree_spec.js @@ -93,38 +93,6 @@ describe('Multi-file store tree actions', () => { }); describe('error', () => { - it('dispatches branch not found actions when response is 404', done => { - const dispatch = jasmine.createSpy('dispatchSpy'); - - store.state.projects = { - 'abc/def': { - web_url: `${gl.TEST_HOST}/files`, - }, - }; - - mock.onGet(/(.*)/).replyOnce(404); - - getFiles( - { - commit() {}, - dispatch, - state: store.state, - }, - { - projectId: 'abc/def', - branchId: 'master-testing', - }, - ) - .then(done.fail) - .catch(() => { - expect(dispatch.calls.argsFor(0)).toEqual([ - 'showBranchNotFoundError', - 'master-testing', - ]); - done(); - }); - }); - it('dispatches error action', done => { const dispatch = jasmine.createSpy('dispatchSpy'); diff --git a/spec/javascripts/ide/stores/actions_spec.js b/spec/javascripts/ide/stores/actions_spec.js index 0b5587d02ae..04e236fb042 100644 --- a/spec/javascripts/ide/stores/actions_spec.js +++ b/spec/javascripts/ide/stores/actions_spec.js @@ -9,12 +9,15 @@ import actions, { setErrorMessage, deleteEntry, renameEntry, + getBranchData, } from '~/ide/stores/actions'; +import axios from '~/lib/utils/axios_utils'; import store from '~/ide/stores'; import * as types from '~/ide/stores/mutation_types'; import router from '~/ide/ide_router'; import { resetStore, file } from '../helpers'; import testAction from '../../helpers/vuex_action_helper'; +import MockAdapter from 'axios-mock-adapter'; describe('Multi-file store actions', () => { beforeEach(() => { @@ -560,4 +563,65 @@ describe('Multi-file store actions', () => { ); }); }); + + describe('getBranchData', () => { + let mock; + + beforeEach(() => { + mock = new MockAdapter(axios); + }); + + afterEach(() => { + mock.restore(); + }); + + describe('error', () => { + let dispatch; + const callParams = [ + { + commit() {}, + state: store.state, + }, + { + projectId: 'abc/def', + branchId: 'master-testing', + }, + ]; + + beforeEach(() => { + dispatch = jasmine.createSpy('dispatchSpy'); + document.body.innerHTML += '<div class="flash-container"></div>'; + }); + + afterEach(() => { + document.querySelector('.flash-container').remove(); + }); + + it('passes the error further unchanged without dispatching any action when response is 404', done => { + mock.onGet(/(.*)/).replyOnce(404); + + getBranchData(...callParams) + .then(done.fail) + .catch(e => { + expect(dispatch.calls.count()).toEqual(0); + expect(e.response.status).toEqual(404); + expect(document.querySelector('.flash-alert')).toBeNull(); + done(); + }); + }); + + it('does not pass the error further and flashes an alert if error is not 404', done => { + mock.onGet(/(.*)/).replyOnce(418); + + getBranchData(...callParams) + .then(done.fail) + .catch(e => { + expect(dispatch.calls.count()).toEqual(0); + expect(e.response).toBeUndefined(); + expect(document.querySelector('.flash-alert')).not.toBeNull(); + done(); + }); + }); + }); + }); }); diff --git a/spec/javascripts/ide/stores/modules/commit/actions_spec.js b/spec/javascripts/ide/stores/modules/commit/actions_spec.js index cdeb9b4b896..4413a12fac4 100644 --- a/spec/javascripts/ide/stores/modules/commit/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/commit/actions_spec.js @@ -272,6 +272,7 @@ describe('IDE commit module actions', () => { short_id: '123', message: 'test message', committed_date: 'date', + parent_ids: '321', stats: { additions: '1', deletions: '2', @@ -463,5 +464,63 @@ describe('IDE commit module actions', () => { .catch(done.fail); }); }); + + describe('first commit of a branch', () => { + const COMMIT_RESPONSE = { + id: '123456', + short_id: '123', + message: 'test message', + committed_date: 'date', + parent_ids: [], + stats: { + additions: '1', + deletions: '2', + }, + }; + + it('commits TOGGLE_EMPTY_STATE mutation on empty repo', done => { + spyOn(service, 'commit').and.returnValue( + Promise.resolve({ + data: COMMIT_RESPONSE, + }), + ); + + spyOn(store, 'commit').and.callThrough(); + + store + .dispatch('commit/commitChanges') + .then(() => { + expect(store.commit.calls.allArgs()).toEqual( + jasmine.arrayContaining([ + ['TOGGLE_EMPTY_STATE', jasmine.any(Object), jasmine.any(Object)], + ]), + ); + done(); + }) + .catch(done.fail); + }); + + it('does not commmit TOGGLE_EMPTY_STATE mutation on existing project', done => { + COMMIT_RESPONSE.parent_ids.push('1234'); + spyOn(service, 'commit').and.returnValue( + Promise.resolve({ + data: COMMIT_RESPONSE, + }), + ); + spyOn(store, 'commit').and.callThrough(); + + store + .dispatch('commit/commitChanges') + .then(() => { + expect(store.commit.calls.allArgs()).not.toEqual( + jasmine.arrayContaining([ + ['TOGGLE_EMPTY_STATE', jasmine.any(Object), jasmine.any(Object)], + ]), + ); + done(); + }) + .catch(done.fail); + }); + }); }); }); diff --git a/spec/javascripts/jobs/components/job_app_spec.js b/spec/javascripts/jobs/components/job_app_spec.js index cef40117304..f28d2c2a882 100644 --- a/spec/javascripts/jobs/components/job_app_spec.js +++ b/spec/javascripts/jobs/components/job_app_spec.js @@ -90,9 +90,12 @@ describe('Job App ', () => { describe('triggered job', () => { beforeEach(() => { + const aYearAgo = new Date(); + aYearAgo.setFullYear(aYearAgo.getFullYear() - 1); + mock .onGet(props.endpoint) - .replyOnce(200, Object.assign({}, job, { started: '2017-05-24T10:59:52.000+01:00' })); + .replyOnce(200, Object.assign({}, job, { started: aYearAgo.toISOString() })); vm = mountComponentWithStore(Component, { props, store }); }); diff --git a/spec/javascripts/jobs/components/sidebar_spec.js b/spec/javascripts/jobs/components/sidebar_spec.js index 26d9effcac5..740bc3d0491 100644 --- a/spec/javascripts/jobs/components/sidebar_spec.js +++ b/spec/javascripts/jobs/components/sidebar_spec.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import sidebarDetailsBlock from '~/jobs/components/sidebar.vue'; import createStore from '~/jobs/store'; -import job, { stages, jobsInStage } from '../mock_data'; +import job, { jobsInStage } from '../mock_data'; import { mountComponentWithStore } from '../../helpers/vue_mount_component_helper'; import { trimText } from '../../helpers/text_helper'; @@ -131,18 +131,8 @@ describe('Sidebar details block', () => { store.dispatch('receiveJobSuccess', job); }); - describe('while fetching stages', () => { - it('it does not render dropdown', () => { - store.dispatch('requestStages'); - vm = mountComponentWithStore(SidebarComponent, { store }); - - expect(vm.$el.querySelector('.js-selected-stage')).toBeNull(); - }); - }); - describe('with stages', () => { beforeEach(() => { - store.dispatch('receiveStagesSuccess', stages); vm = mountComponentWithStore(SidebarComponent, { store }); }); @@ -156,7 +146,6 @@ describe('Sidebar details block', () => { describe('without jobs for stages', () => { beforeEach(() => { store.dispatch('receiveJobSuccess', job); - store.dispatch('receiveStagesSuccess', stages); vm = mountComponentWithStore(SidebarComponent, { store }); }); @@ -168,7 +157,6 @@ describe('Sidebar details block', () => { describe('with jobs for stages', () => { beforeEach(() => { store.dispatch('receiveJobSuccess', job); - store.dispatch('receiveStagesSuccess', stages); store.dispatch('receiveJobsForStageSuccess', jobsInStage.latest_statuses); vm = mountComponentWithStore(SidebarComponent, { store }); }); diff --git a/spec/javascripts/jobs/components/stages_dropdown_spec.js b/spec/javascripts/jobs/components/stages_dropdown_spec.js index 52bb5161123..e98639bf21e 100644 --- a/spec/javascripts/jobs/components/stages_dropdown_spec.js +++ b/spec/javascripts/jobs/components/stages_dropdown_spec.js @@ -9,6 +9,7 @@ describe('Stages Dropdown', () => { const mockPipelineData = { id: 28029444, + iid: 123, details: { status: { details_path: '/gitlab-org/gitlab-ce/pipelines/28029444', @@ -77,8 +78,8 @@ describe('Stages Dropdown', () => { expect(vm.$el.querySelector('.dropdown .js-selected-stage').textContent).toContain('deploy'); }); - it(`renders the pipeline info text like "Pipeline #123 for source_branch"`, () => { - const expected = `Pipeline #${pipeline.id} for ${pipeline.ref.name}`; + it(`renders the pipeline info text like "Pipeline #123 (#12) for source_branch"`, () => { + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for ${pipeline.ref.name}`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); expect(actual).toBe(expected); @@ -100,10 +101,10 @@ describe('Stages Dropdown', () => { }); }); - it(`renders the pipeline info text like "Pipeline #123 for !456 with source_branch into target_branch"`, () => { - const expected = `Pipeline #${pipeline.id} for !${pipeline.merge_request.iid} with ${ - pipeline.merge_request.source_branch - } into ${pipeline.merge_request.target_branch}`; + it(`renders the pipeline info text like "Pipeline #123 (#12) for !456 with source_branch into target_branch"`, () => { + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for !${ + pipeline.merge_request.iid + } with ${pipeline.merge_request.source_branch} into ${pipeline.merge_request.target_branch}`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); expect(actual).toBe(expected); @@ -143,10 +144,10 @@ describe('Stages Dropdown', () => { }); }); - it(`renders the pipeline info like "Pipeline #123 for !456 with source_branch"`, () => { - const expected = `Pipeline #${pipeline.id} for !${pipeline.merge_request.iid} with ${ - pipeline.merge_request.source_branch - }`; + it(`renders the pipeline info like "Pipeline #123 (#12) for !456 with source_branch"`, () => { + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for !${ + pipeline.merge_request.iid + } with ${pipeline.merge_request.source_branch}`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); expect(actual).toBe(expected); diff --git a/spec/javascripts/jobs/mock_data.js b/spec/javascripts/jobs/mock_data.js index 1a7f338c5fa..88b0bb206ee 100644 --- a/spec/javascripts/jobs/mock_data.js +++ b/spec/javascripts/jobs/mock_data.js @@ -3,140 +3,6 @@ import { TEST_HOST } from 'spec/test_constants'; const threeWeeksAgo = new Date(); threeWeeksAgo.setDate(threeWeeksAgo.getDate() - 21); -export default { - id: 4757, - name: 'test', - build_path: '/root/ci-mock/-/jobs/4757', - retry_path: '/root/ci-mock/-/jobs/4757/retry', - cancel_path: '/root/ci-mock/-/jobs/4757/cancel', - new_issue_path: '/root/ci-mock/issues/new', - playable: false, - created_at: threeWeeksAgo.toISOString(), - updated_at: threeWeeksAgo.toISOString(), - finished_at: threeWeeksAgo.toISOString(), - queued: 9.54, - status: { - icon: 'status_success', - text: 'passed', - label: 'passed', - group: 'success', - has_details: true, - details_path: `${TEST_HOST}/root/ci-mock/-/jobs/4757`, - favicon: - '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', - action: { - icon: 'retry', - title: 'Retry', - path: '/root/ci-mock/-/jobs/4757/retry', - method: 'post', - }, - }, - coverage: 20, - erased_at: threeWeeksAgo.toISOString(), - erased: false, - duration: 6.785563, - tags: ['tag'], - user: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - erase_path: '/root/ci-mock/-/jobs/4757/erase', - artifacts: [null], - runner: { - id: 1, - description: 'local ci runner', - edit_path: '/root/ci-mock/runners/1/edit', - }, - pipeline: { - id: 140, - user: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - active: false, - coverage: null, - source: 'unknown', - created_at: '2017-05-24T09:59:58.634Z', - updated_at: '2017-06-01T17:32:00.062Z', - path: '/root/ci-mock/pipelines/140', - flags: { - latest: true, - stuck: false, - yaml_errors: false, - retryable: false, - cancelable: false, - }, - details: { - status: { - icon: 'status_success', - text: 'passed', - label: 'passed', - group: 'success', - has_details: true, - details_path: '/root/ci-mock/pipelines/140', - favicon: - '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', - }, - duration: 6, - finished_at: '2017-06-01T17:32:00.042Z', - }, - ref: { - name: 'abc', - path: '/root/ci-mock/commits/abc', - tag: false, - branch: true, - }, - commit: { - id: 'c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - short_id: 'c5864777', - title: 'Add new file', - created_at: '2017-05-24T10:59:52.000+01:00', - parent_ids: ['798e5f902592192afaba73f4668ae30e56eae492'], - message: 'Add new file', - author_name: 'Root', - author_email: 'admin@example.com', - authored_date: '2017-05-24T10:59:52.000+01:00', - committer_name: 'Root', - committer_email: 'admin@example.com', - committed_date: '2017-05-24T10:59:52.000+01:00', - author: { - name: 'Root', - username: 'root', - id: 1, - state: 'active', - avatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - web_url: 'http://localhost:3000/root', - }, - author_gravatar_url: - 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', - commit_url: - 'http://localhost:3000/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', - }, - }, - metadata: { - timeout_human_readable: '1m 40s', - timeout_source: 'runner', - }, - merge_request: { - iid: 2, - path: '/root/ci-mock/merge_requests/2', - }, - raw_path: '/root/ci-mock/builds/4757/raw', - has_trace: true, -}; - export const stages = [ { name: 'build', @@ -1043,6 +909,168 @@ export const stages = [ }, ]; +export default { + id: 4757, + name: 'test', + build_path: '/root/ci-mock/-/jobs/4757', + retry_path: '/root/ci-mock/-/jobs/4757/retry', + cancel_path: '/root/ci-mock/-/jobs/4757/cancel', + new_issue_path: '/root/ci-mock/issues/new', + playable: false, + created_at: threeWeeksAgo.toISOString(), + updated_at: threeWeeksAgo.toISOString(), + finished_at: threeWeeksAgo.toISOString(), + queued: 9.54, + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + has_details: true, + details_path: `${TEST_HOST}/root/ci-mock/-/jobs/4757`, + favicon: + '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', + action: { + icon: 'retry', + title: 'Retry', + path: '/root/ci-mock/-/jobs/4757/retry', + method: 'post', + }, + }, + coverage: 20, + erased_at: threeWeeksAgo.toISOString(), + erased: false, + duration: 6.785563, + tags: ['tag'], + user: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + erase_path: '/root/ci-mock/-/jobs/4757/erase', + artifacts: [null], + runner: { + id: 1, + description: 'local ci runner', + edit_path: '/root/ci-mock/runners/1/edit', + }, + pipeline: { + id: 140, + iid: 13, + user: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + active: false, + coverage: null, + source: 'unknown', + created_at: '2017-05-24T09:59:58.634Z', + updated_at: '2017-06-01T17:32:00.062Z', + path: '/root/ci-mock/pipelines/140', + flags: { + latest: true, + stuck: false, + yaml_errors: false, + retryable: false, + cancelable: false, + }, + details: { + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + has_details: true, + details_path: '/root/ci-mock/pipelines/140', + favicon: + '/assets/ci_favicons/favicon_status_success-308b4fc054cdd1b68d0865e6cfb7b02e92e3472f201507418f8eddb74ac11a59.png', + }, + duration: 6, + finished_at: '2017-06-01T17:32:00.042Z', + stages: [ + { + dropdown_path: '/jashkenas/underscore/pipelines/16/stage.json?stage=build', + name: 'build', + path: '/jashkenas/underscore/pipelines/16#build', + status: { + icon: 'status_success', + text: 'passed', + label: 'passed', + group: 'success', + tooltip: 'passed', + }, + title: 'build: passed', + }, + { + dropdown_path: '/jashkenas/underscore/pipelines/16/stage.json?stage=test', + name: 'test', + path: '/jashkenas/underscore/pipelines/16#test', + status: { + icon: 'status_warning', + text: 'passed', + label: 'passed with warnings', + group: 'success-with-warnings', + }, + title: 'test: passed with warnings', + }, + ], + }, + ref: { + name: 'abc', + path: '/root/ci-mock/commits/abc', + tag: false, + branch: true, + }, + commit: { + id: 'c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + short_id: 'c5864777', + title: 'Add new file', + created_at: '2017-05-24T10:59:52.000+01:00', + parent_ids: ['798e5f902592192afaba73f4668ae30e56eae492'], + message: 'Add new file', + author_name: 'Root', + author_email: 'admin@example.com', + authored_date: '2017-05-24T10:59:52.000+01:00', + committer_name: 'Root', + committer_email: 'admin@example.com', + committed_date: '2017-05-24T10:59:52.000+01:00', + author: { + name: 'Root', + username: 'root', + id: 1, + state: 'active', + avatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + web_url: 'http://localhost:3000/root', + }, + author_gravatar_url: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon', + commit_url: + 'http://localhost:3000/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', + }, + }, + metadata: { + timeout_human_readable: '1m 40s', + timeout_source: 'runner', + }, + merge_request: { + iid: 2, + path: '/root/ci-mock/merge_requests/2', + }, + raw_path: '/root/ci-mock/builds/4757/raw', + has_trace: true, +}; + export const jobsInStage = { name: 'build', title: 'build: running', diff --git a/spec/javascripts/jobs/store/actions_spec.js b/spec/javascripts/jobs/store/actions_spec.js index 77b44995b12..7b96df85b82 100644 --- a/spec/javascripts/jobs/store/actions_spec.js +++ b/spec/javascripts/jobs/store/actions_spec.js @@ -16,10 +16,6 @@ import { stopPollingTrace, receiveTraceSuccess, receiveTraceError, - requestStages, - fetchStages, - receiveStagesSuccess, - receiveStagesError, requestJobsForStage, fetchJobsForStage, receiveJobsForStageSuccess, @@ -307,107 +303,6 @@ describe('Job State actions', () => { }); }); - describe('requestStages', () => { - it('should commit REQUEST_STAGES mutation ', done => { - testAction(requestStages, null, mockedState, [{ type: types.REQUEST_STAGES }], [], done); - }); - }); - - describe('fetchStages', () => { - let mock; - - beforeEach(() => { - mockedState.job.pipeline = { - path: `${TEST_HOST}/endpoint`, - }; - mockedState.selectedStage = 'deploy'; - mock = new MockAdapter(axios); - }); - - afterEach(() => { - mock.restore(); - }); - - describe('success', () => { - it('dispatches requestStages and receiveStagesSuccess, fetchJobsForStage ', done => { - mock - .onGet(`${TEST_HOST}/endpoint.json`) - .replyOnce(200, { details: { stages: [{ name: 'build' }, { name: 'deploy' }] } }); - - testAction( - fetchStages, - null, - mockedState, - [], - [ - { - type: 'requestStages', - }, - { - payload: [{ name: 'build' }, { name: 'deploy' }], - type: 'receiveStagesSuccess', - }, - { - payload: { name: 'deploy' }, - type: 'fetchJobsForStage', - }, - ], - done, - ); - }); - }); - - describe('error', () => { - beforeEach(() => { - mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500); - }); - - it('dispatches requestStages and receiveStagesError ', done => { - testAction( - fetchStages, - null, - mockedState, - [], - [ - { - type: 'requestStages', - }, - { - type: 'receiveStagesError', - }, - ], - done, - ); - }); - }); - }); - - describe('receiveStagesSuccess', () => { - it('should commit RECEIVE_STAGES_SUCCESS mutation ', done => { - testAction( - receiveStagesSuccess, - {}, - mockedState, - [{ type: types.RECEIVE_STAGES_SUCCESS, payload: {} }], - [], - done, - ); - }); - }); - - describe('receiveStagesError', () => { - it('should commit RECEIVE_STAGES_ERROR mutation ', done => { - testAction( - receiveStagesError, - null, - mockedState, - [{ type: types.RECEIVE_STAGES_ERROR }], - [], - done, - ); - }); - }); - describe('requestJobsForStage', () => { it('should commit REQUEST_JOBS_FOR_STAGE mutation ', done => { testAction( diff --git a/spec/javascripts/lib/utils/datetime_utility_spec.js b/spec/javascripts/lib/utils/datetime_utility_spec.js deleted file mode 100644 index 5327ec9d2a0..00000000000 --- a/spec/javascripts/lib/utils/datetime_utility_spec.js +++ /dev/null @@ -1,416 +0,0 @@ -import * as datetimeUtility from '~/lib/utils/datetime_utility'; - -describe('Date time utils', () => { - describe('timeFor', () => { - it('returns `past due` when in past', () => { - const date = new Date(); - date.setFullYear(date.getFullYear() - 1); - - expect(datetimeUtility.timeFor(date)).toBe('Past due'); - }); - - it('returns remaining time when in the future', () => { - const date = new Date(); - date.setFullYear(date.getFullYear() + 1); - - // Add a day to prevent a transient error. If date is even 1 second - // short of a full year, timeFor will return '11 months remaining' - date.setDate(date.getDate() + 1); - - expect(datetimeUtility.timeFor(date)).toBe('1 year remaining'); - }); - }); - - describe('get day name', () => { - it('should return Sunday', () => { - const day = datetimeUtility.getDayName(new Date('07/17/2016')); - - expect(day).toBe('Sunday'); - }); - - it('should return Monday', () => { - const day = datetimeUtility.getDayName(new Date('07/18/2016')); - - expect(day).toBe('Monday'); - }); - - it('should return Tuesday', () => { - const day = datetimeUtility.getDayName(new Date('07/19/2016')); - - expect(day).toBe('Tuesday'); - }); - - it('should return Wednesday', () => { - const day = datetimeUtility.getDayName(new Date('07/20/2016')); - - expect(day).toBe('Wednesday'); - }); - - it('should return Thursday', () => { - const day = datetimeUtility.getDayName(new Date('07/21/2016')); - - expect(day).toBe('Thursday'); - }); - - it('should return Friday', () => { - const day = datetimeUtility.getDayName(new Date('07/22/2016')); - - expect(day).toBe('Friday'); - }); - - it('should return Saturday', () => { - const day = datetimeUtility.getDayName(new Date('07/23/2016')); - - expect(day).toBe('Saturday'); - }); - }); - - describe('get day difference', () => { - it('should return 7', () => { - const firstDay = new Date('07/01/2016'); - const secondDay = new Date('07/08/2016'); - const difference = datetimeUtility.getDayDifference(firstDay, secondDay); - - expect(difference).toBe(7); - }); - - it('should return 31', () => { - const firstDay = new Date('07/01/2016'); - const secondDay = new Date('08/01/2016'); - const difference = datetimeUtility.getDayDifference(firstDay, secondDay); - - expect(difference).toBe(31); - }); - - it('should return 365', () => { - const firstDay = new Date('07/02/2015'); - const secondDay = new Date('07/01/2016'); - const difference = datetimeUtility.getDayDifference(firstDay, secondDay); - - expect(difference).toBe(365); - }); - }); -}); - -describe('timeIntervalInWords', () => { - it('should return string with number of minutes and seconds', () => { - expect(datetimeUtility.timeIntervalInWords(9.54)).toEqual('9 seconds'); - expect(datetimeUtility.timeIntervalInWords(1)).toEqual('1 second'); - expect(datetimeUtility.timeIntervalInWords(200)).toEqual('3 minutes 20 seconds'); - expect(datetimeUtility.timeIntervalInWords(6008)).toEqual('100 minutes 8 seconds'); - }); -}); - -describe('dateInWords', () => { - const date = new Date('07/01/2016'); - - it('should return date in words', () => { - expect(datetimeUtility.dateInWords(date)).toEqual('July 1, 2016'); - }); - - it('should return abbreviated month name', () => { - expect(datetimeUtility.dateInWords(date, true)).toEqual('Jul 1, 2016'); - }); - - it('should return date in words without year', () => { - expect(datetimeUtility.dateInWords(date, true, true)).toEqual('Jul 1'); - }); -}); - -describe('monthInWords', () => { - const date = new Date('2017-01-20'); - - it('returns month name from provided date', () => { - expect(datetimeUtility.monthInWords(date)).toBe('January'); - }); - - it('returns abbreviated month name from provided date', () => { - expect(datetimeUtility.monthInWords(date, true)).toBe('Jan'); - }); -}); - -describe('totalDaysInMonth', () => { - it('returns number of days in a month for given date', () => { - // 1st Feb, 2016 (leap year) - expect(datetimeUtility.totalDaysInMonth(new Date(2016, 1, 1))).toBe(29); - - // 1st Feb, 2017 - expect(datetimeUtility.totalDaysInMonth(new Date(2017, 1, 1))).toBe(28); - - // 1st Jan, 2017 - expect(datetimeUtility.totalDaysInMonth(new Date(2017, 0, 1))).toBe(31); - }); -}); - -describe('getSundays', () => { - it('returns array of dates representing all Sundays of the month', () => { - // December, 2017 (it has 5 Sundays) - const dateOfSundays = [3, 10, 17, 24, 31]; - const sundays = datetimeUtility.getSundays(new Date(2017, 11, 1)); - - expect(sundays.length).toBe(5); - sundays.forEach((sunday, index) => { - expect(sunday.getDate()).toBe(dateOfSundays[index]); - }); - }); -}); - -describe('getTimeframeWindowFrom', () => { - it('returns array of date objects upto provided length (positive number) into the future starting from provided startDate', () => { - const startDate = new Date(2018, 0, 1); - const mockTimeframe = [ - new Date(2018, 0, 1), - new Date(2018, 1, 1), - new Date(2018, 2, 1), - new Date(2018, 3, 1), - new Date(2018, 4, 31), - ]; - const timeframe = datetimeUtility.getTimeframeWindowFrom(startDate, 5); - - expect(timeframe.length).toBe(5); - timeframe.forEach((timeframeItem, index) => { - expect(timeframeItem.getFullYear()).toBe(mockTimeframe[index].getFullYear()); - expect(timeframeItem.getMonth()).toBe(mockTimeframe[index].getMonth()); - expect(timeframeItem.getDate()).toBe(mockTimeframe[index].getDate()); - }); - }); - - it('returns array of date objects upto provided length (negative number) into the past starting from provided startDate', () => { - const startDate = new Date(2018, 0, 1); - const mockTimeframe = [ - new Date(2018, 0, 1), - new Date(2017, 11, 1), - new Date(2017, 10, 1), - new Date(2017, 9, 1), - new Date(2017, 8, 1), - ]; - const timeframe = datetimeUtility.getTimeframeWindowFrom(startDate, -5); - - expect(timeframe.length).toBe(5); - timeframe.forEach((timeframeItem, index) => { - expect(timeframeItem.getFullYear()).toBe(mockTimeframe[index].getFullYear()); - expect(timeframeItem.getMonth()).toBe(mockTimeframe[index].getMonth()); - expect(timeframeItem.getDate()).toBe(mockTimeframe[index].getDate()); - }); - }); -}); - -describe('formatTime', () => { - const expectedTimestamps = [ - [0, '00:00:00'], - [1000, '00:00:01'], - [42000, '00:00:42'], - [121000, '00:02:01'], - [10921000, '03:02:01'], - [108000000, '30:00:00'], - ]; - - expectedTimestamps.forEach(([milliseconds, expectedTimestamp]) => { - it(`formats ${milliseconds}ms as ${expectedTimestamp}`, () => { - expect(datetimeUtility.formatTime(milliseconds)).toBe(expectedTimestamp); - }); - }); -}); - -describe('datefix', () => { - describe('pad', () => { - it('should add a 0 when length is smaller than 2', () => { - expect(datetimeUtility.pad(2)).toEqual('02'); - }); - - it('should not add a zero when length matches the default', () => { - expect(datetimeUtility.pad(12)).toEqual('12'); - }); - - it('should add a 0 when length is smaller than the provided', () => { - expect(datetimeUtility.pad(12, 3)).toEqual('012'); - }); - }); - - describe('parsePikadayDate', () => { - // removed because of https://gitlab.com/gitlab-org/gitlab-ce/issues/39834 - }); - - describe('pikadayToString', () => { - it('should format a UTC date into yyyy-mm-dd format', () => { - expect(datetimeUtility.pikadayToString(new Date('2020-01-29:00:00'))).toEqual('2020-01-29'); - }); - }); -}); - -describe('prettyTime methods', () => { - const assertTimeUnits = (obj, minutes, hours, days, weeks) => { - expect(obj.minutes).toBe(minutes); - expect(obj.hours).toBe(hours); - expect(obj.days).toBe(days); - expect(obj.weeks).toBe(weeks); - }; - - describe('parseSeconds', () => { - it('should correctly parse a negative value', () => { - const zeroSeconds = datetimeUtility.parseSeconds(-1000); - - assertTimeUnits(zeroSeconds, 16, 0, 0, 0); - }); - - it('should correctly parse a zero value', () => { - const zeroSeconds = datetimeUtility.parseSeconds(0); - - assertTimeUnits(zeroSeconds, 0, 0, 0, 0); - }); - - it('should correctly parse a small non-zero second values', () => { - const subOneMinute = datetimeUtility.parseSeconds(10); - const aboveOneMinute = datetimeUtility.parseSeconds(100); - const manyMinutes = datetimeUtility.parseSeconds(1000); - - assertTimeUnits(subOneMinute, 0, 0, 0, 0); - assertTimeUnits(aboveOneMinute, 1, 0, 0, 0); - assertTimeUnits(manyMinutes, 16, 0, 0, 0); - }); - - it('should correctly parse large second values', () => { - const aboveOneHour = datetimeUtility.parseSeconds(4800); - const aboveOneDay = datetimeUtility.parseSeconds(110000); - const aboveOneWeek = datetimeUtility.parseSeconds(25000000); - - assertTimeUnits(aboveOneHour, 20, 1, 0, 0); - assertTimeUnits(aboveOneDay, 33, 6, 3, 0); - assertTimeUnits(aboveOneWeek, 26, 0, 3, 173); - }); - - it('should correctly accept a custom param for hoursPerDay', () => { - const config = { hoursPerDay: 24 }; - - const aboveOneHour = datetimeUtility.parseSeconds(4800, config); - const aboveOneDay = datetimeUtility.parseSeconds(110000, config); - const aboveOneWeek = datetimeUtility.parseSeconds(25000000, config); - - assertTimeUnits(aboveOneHour, 20, 1, 0, 0); - assertTimeUnits(aboveOneDay, 33, 6, 1, 0); - assertTimeUnits(aboveOneWeek, 26, 8, 4, 57); - }); - - it('should correctly accept a custom param for daysPerWeek', () => { - const config = { daysPerWeek: 7 }; - - const aboveOneHour = datetimeUtility.parseSeconds(4800, config); - const aboveOneDay = datetimeUtility.parseSeconds(110000, config); - const aboveOneWeek = datetimeUtility.parseSeconds(25000000, config); - - assertTimeUnits(aboveOneHour, 20, 1, 0, 0); - assertTimeUnits(aboveOneDay, 33, 6, 3, 0); - assertTimeUnits(aboveOneWeek, 26, 0, 0, 124); - }); - - it('should correctly accept custom params for daysPerWeek and hoursPerDay', () => { - const config = { daysPerWeek: 55, hoursPerDay: 14 }; - - const aboveOneHour = datetimeUtility.parseSeconds(4800, config); - const aboveOneDay = datetimeUtility.parseSeconds(110000, config); - const aboveOneWeek = datetimeUtility.parseSeconds(25000000, config); - - assertTimeUnits(aboveOneHour, 20, 1, 0, 0); - assertTimeUnits(aboveOneDay, 33, 2, 2, 0); - assertTimeUnits(aboveOneWeek, 26, 0, 1, 9); - }); - }); - - describe('stringifyTime', () => { - it('should stringify values with all non-zero units', () => { - const timeObject = { - weeks: 1, - days: 4, - hours: 7, - minutes: 20, - }; - - const timeString = datetimeUtility.stringifyTime(timeObject); - - expect(timeString).toBe('1w 4d 7h 20m'); - }); - - it('should stringify values with some non-zero units', () => { - const timeObject = { - weeks: 0, - days: 4, - hours: 0, - minutes: 20, - }; - - const timeString = datetimeUtility.stringifyTime(timeObject); - - expect(timeString).toBe('4d 20m'); - }); - - it('should stringify values with no non-zero units', () => { - const timeObject = { - weeks: 0, - days: 0, - hours: 0, - minutes: 0, - }; - - const timeString = datetimeUtility.stringifyTime(timeObject); - - expect(timeString).toBe('0m'); - }); - - it('should return non-condensed representation of time object', () => { - const timeObject = { weeks: 1, days: 0, hours: 1, minutes: 0 }; - - expect(datetimeUtility.stringifyTime(timeObject, true)).toEqual('1 week 1 hour'); - }); - }); - - describe('abbreviateTime', () => { - it('should abbreviate stringified times for weeks', () => { - const fullTimeString = '1w 3d 4h 5m'; - - expect(datetimeUtility.abbreviateTime(fullTimeString)).toBe('1w'); - }); - - it('should abbreviate stringified times for non-weeks', () => { - const fullTimeString = '0w 3d 4h 5m'; - - expect(datetimeUtility.abbreviateTime(fullTimeString)).toBe('3d'); - }); - }); -}); - -describe('calculateRemainingMilliseconds', () => { - beforeEach(() => { - spyOn(Date, 'now').and.callFake(() => new Date('2063-04-04T00:42:00Z').getTime()); - }); - - it('calculates the remaining time for a given end date', () => { - const milliseconds = datetimeUtility.calculateRemainingMilliseconds('2063-04-04T01:44:03Z'); - - expect(milliseconds).toBe(3723000); - }); - - it('returns 0 if the end date has passed', () => { - const milliseconds = datetimeUtility.calculateRemainingMilliseconds('2063-04-03T00:00:00Z'); - - expect(milliseconds).toBe(0); - }); -}); - -describe('newDate', () => { - it('returns new date instance from existing date instance', () => { - const initialDate = new Date(2019, 0, 1); - const copiedDate = datetimeUtility.newDate(initialDate); - - expect(copiedDate.getTime()).toBe(initialDate.getTime()); - - initialDate.setMonth(initialDate.getMonth() + 1); - - expect(copiedDate.getTime()).not.toBe(initialDate.getTime()); - }); - - it('returns date instance when provided date param is not of type date or is undefined', () => { - const initialDate = datetimeUtility.newDate(); - - expect(initialDate instanceof Date).toBe(true); - }); -}); diff --git a/spec/javascripts/lib/utils/url_utility_spec.js b/spec/javascripts/lib/utils/url_utility_spec.js deleted file mode 100644 index 381c7b2d0a6..00000000000 --- a/spec/javascripts/lib/utils/url_utility_spec.js +++ /dev/null @@ -1,110 +0,0 @@ -import * as urlUtils from '~/lib/utils/url_utility'; - -describe('URL utility', () => { - describe('webIDEUrl', () => { - afterEach(() => { - gon.relative_url_root = ''; - }); - - describe('without relative_url_root', () => { - it('returns IDE path with route', () => { - expect(urlUtils.webIDEUrl('/gitlab-org/gitlab-ce/merge_requests/1')).toBe( - '/-/ide/project/gitlab-org/gitlab-ce/merge_requests/1', - ); - }); - }); - - describe('with relative_url_root', () => { - beforeEach(() => { - gon.relative_url_root = '/gitlab'; - }); - - it('returns IDE path with route', () => { - expect(urlUtils.webIDEUrl('/gitlab/gitlab-org/gitlab-ce/merge_requests/1')).toBe( - '/gitlab/-/ide/project/gitlab-org/gitlab-ce/merge_requests/1', - ); - }); - }); - }); - - describe('mergeUrlParams', () => { - it('adds w', () => { - expect(urlUtils.mergeUrlParams({ w: 1 }, '#frag')).toBe('?w=1#frag'); - expect(urlUtils.mergeUrlParams({ w: 1 }, '/path#frag')).toBe('/path?w=1#frag'); - expect(urlUtils.mergeUrlParams({ w: 1 }, 'https://host/path')).toBe('https://host/path?w=1'); - expect(urlUtils.mergeUrlParams({ w: 1 }, 'https://host/path#frag')).toBe( - 'https://host/path?w=1#frag', - ); - - expect(urlUtils.mergeUrlParams({ w: 1 }, 'https://h/p?k1=v1#frag')).toBe( - 'https://h/p?k1=v1&w=1#frag', - ); - }); - - it('updates w', () => { - expect(urlUtils.mergeUrlParams({ w: 1 }, '?k1=v1&w=0#frag')).toBe('?k1=v1&w=1#frag'); - }); - - it('adds multiple params', () => { - expect(urlUtils.mergeUrlParams({ a: 1, b: 2, c: 3 }, '#frag')).toBe('?a=1&b=2&c=3#frag'); - }); - - it('adds and updates encoded params', () => { - expect(urlUtils.mergeUrlParams({ a: '&', q: '?' }, '?a=%23#frag')).toBe('?a=%26&q=%3F#frag'); - }); - }); - - describe('removeParams', () => { - describe('when url is passed', () => { - it('removes query param with encoded ampersand', () => { - const url = urlUtils.removeParams(['filter'], '/mail?filter=n%3Djoe%26l%3Dhome'); - - expect(url).toBe('/mail'); - }); - - it('should remove param when url has no other params', () => { - const url = urlUtils.removeParams(['size'], '/feature/home?size=5'); - - expect(url).toBe('/feature/home'); - }); - - it('should remove param when url has other params', () => { - const url = urlUtils.removeParams(['size'], '/feature/home?q=1&size=5&f=html'); - - expect(url).toBe('/feature/home?q=1&f=html'); - }); - - it('should remove param and preserve fragment', () => { - const url = urlUtils.removeParams(['size'], '/feature/home?size=5#H2'); - - expect(url).toBe('/feature/home#H2'); - }); - - it('should remove multiple params', () => { - const url = urlUtils.removeParams(['z', 'a'], '/home?z=11111&l=en_US&a=true#H2'); - - expect(url).toBe('/home?l=en_US#H2'); - }); - }); - }); - - describe('setUrlFragment', () => { - it('should set fragment when url has no fragment', () => { - const url = urlUtils.setUrlFragment('/home/feature', 'usage'); - - expect(url).toBe('/home/feature#usage'); - }); - - it('should set fragment when url has existing fragment', () => { - const url = urlUtils.setUrlFragment('/home/feature#overview', 'usage'); - - expect(url).toBe('/home/feature#usage'); - }); - - it('should set fragment when given fragment includes #', () => { - const url = urlUtils.setUrlFragment('/home/feature#overview', '#install'); - - expect(url).toBe('/home/feature#install'); - }); - }); -}); diff --git a/spec/javascripts/matchers.js b/spec/javascripts/matchers.js index 406527b08a3..7d1921cabcf 100644 --- a/spec/javascripts/matchers.js +++ b/spec/javascripts/matchers.js @@ -28,7 +28,7 @@ export default { reference.getAttribute('xlink:href').endsWith(`#${iconName}`), ); const result = { - pass: !!matchingIcon, + pass: Boolean(matchingIcon), }; if (result.pass) { diff --git a/spec/javascripts/monitoring/charts/area_spec.js b/spec/javascripts/monitoring/charts/area_spec.js index 41a6c04efb9..56609665b88 100644 --- a/spec/javascripts/monitoring/charts/area_spec.js +++ b/spec/javascripts/monitoring/charts/area_spec.js @@ -2,7 +2,8 @@ import { shallowMount } from '@vue/test-utils'; import { GlAreaChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts'; import { shallowWrapperContainsSlotText } from 'spec/helpers/vue_test_utils_helper'; import Area from '~/monitoring/components/charts/area.vue'; -import MonitoringStore from '~/monitoring/stores/monitoring_store'; +import { createStore } from '~/monitoring/stores'; +import * as types from '~/monitoring/stores/mutation_types'; import MonitoringMock, { deploymentData } from '../mock_data'; describe('Area component', () => { @@ -13,17 +14,18 @@ describe('Area component', () => { let spriteSpy; beforeEach(() => { - const store = new MonitoringStore(); - store.storeMetrics(MonitoringMock.data); - store.storeDeploymentData(deploymentData); + const store = createStore(); - [mockGraphData] = store.groups[0].metrics; + store.commit(`monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, MonitoringMock.data); + store.commit(`monitoringDashboard/${types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS}`, deploymentData); + + [mockGraphData] = store.state.monitoringDashboard.groups[0].metrics; areaChart = shallowMount(Area, { propsData: { graphData: mockGraphData, containerWidth: 0, - deploymentData: store.deploymentData, + deploymentData: store.state.monitoringDashboard.deploymentData, }, slots: { default: mockWidgets, diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js index e9bd6050d68..cea8cb18918 100644 --- a/spec/javascripts/monitoring/dashboard_spec.js +++ b/spec/javascripts/monitoring/dashboard_spec.js @@ -2,8 +2,15 @@ import Vue from 'vue'; import MockAdapter from 'axios-mock-adapter'; import Dashboard from '~/monitoring/components/dashboard.vue'; import { timeWindows, timeWindowsKeyNames } from '~/monitoring/constants'; +import * as types from '~/monitoring/stores/mutation_types'; +import { createStore } from '~/monitoring/stores'; import axios from '~/lib/utils/axios_utils'; -import { metricsGroupsAPIResponse, mockApiEndpoint, environmentData } from './mock_data'; +import { + metricsGroupsAPIResponse, + mockApiEndpoint, + environmentData, + singleGroupResponse, +} from './mock_data'; const propsData = { hasMetrics: false, @@ -30,6 +37,7 @@ export default propsData; describe('Dashboard', () => { let DashboardComponent; let mock; + let store; beforeEach(() => { setFixtures(` @@ -45,6 +53,7 @@ describe('Dashboard', () => { }, }; + store = createStore(); mock = new MockAdapter(axios); DashboardComponent = Vue.extend(Dashboard); }); @@ -58,10 +67,11 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, showTimeWindowDropdown: false }, + store, }); expect(component.$el.querySelector('.prometheus-graphs')).toBe(null); - expect(component.state).toEqual('gettingStarted'); + expect(component.emptyState).toEqual('gettingStarted'); }); }); @@ -74,10 +84,11 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: false }, + store, }); Vue.nextTick(() => { - expect(component.state).toEqual('loading'); + expect(component.emptyState).toEqual('loading'); done(); }); }); @@ -91,6 +102,7 @@ describe('Dashboard', () => { showLegend: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -110,6 +122,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -129,16 +142,24 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData(environmentData); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, + environmentData, + ); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); setTimeout(() => { const dropdownMenuEnvironments = component.$el.querySelectorAll( '.js-environments-dropdown .dropdown-item', ); - expect(dropdownMenuEnvironments.length).toEqual(component.store.environmentsData.length); + expect(dropdownMenuEnvironments.length).toEqual(component.environments.length); done(); }); }); @@ -152,18 +173,25 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData([]); + component.$store.commit(`monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, []); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); - setTimeout(() => { - const dropdownMenuEnvironments = component.$el.querySelectorAll( - '.js-environments-dropdown .dropdown-item', - ); + Vue.nextTick() + .then(() => { + const dropdownMenuEnvironments = component.$el.querySelectorAll( + '.js-environments-dropdown .dropdown-item', + ); - expect(dropdownMenuEnvironments.length).toEqual(0); - done(); - }); + expect(dropdownMenuEnvironments.length).toEqual(0); + done(); + }) + .catch(done.fail); }); it('renders the environments dropdown with a single active element', done => { @@ -175,19 +203,28 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); - component.store.storeEnvironmentsData(environmentData); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS}`, + environmentData, + ); + component.$store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DATA_SUCCESS}`, + singleGroupResponse, + ); - setTimeout(() => { - const dropdownItems = component.$el.querySelectorAll( - '.js-environments-dropdown .dropdown-item[active="true"]', - ); + Vue.nextTick() + .then(() => { + const dropdownItems = component.$el.querySelectorAll( + '.js-environments-dropdown .dropdown-item[active="true"]', + ); - expect(dropdownItems.length).toEqual(1); - expect(dropdownItems[0].textContent.trim()).toEqual(component.currentEnvironmentName); - done(); - }); + expect(dropdownItems.length).toEqual(1); + done(); + }) + .catch(done.fail); }); it('hides the dropdown', done => { @@ -200,6 +237,7 @@ describe('Dashboard', () => { environmentsEndpoint: '', showTimeWindowDropdown: false, }, + store, }); Vue.nextTick(() => { @@ -219,6 +257,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); setTimeout(() => { @@ -239,6 +278,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: true, }, + store, }); const numberOfTimeWindows = Object.keys(timeWindows).length; @@ -261,6 +301,7 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, + store, }); setTimeout(() => { @@ -281,6 +322,7 @@ describe('Dashboard', () => { const component = new DashboardComponent({ el: document.querySelector('.prometheus-graphs'), propsData: { ...propsData, hasMetrics: true, showTimeWindowDropdown: true }, + store, }); Vue.nextTick(() => { @@ -310,6 +352,7 @@ describe('Dashboard', () => { showPanels: false, showTimeWindowDropdown: false, }, + store, }); expect(component.elWidth).toEqual(0); @@ -350,8 +393,9 @@ describe('Dashboard', () => { hasMetrics: true, showPanels: false, showTimeWindowDropdown: false, - externalDashboardPath: '/mockPath', + externalDashboardUrl: '/mockUrl', }, + store, }); }); @@ -375,8 +419,9 @@ describe('Dashboard', () => { hasMetrics: true, showPanels: false, showTimeWindowDropdown: false, - externalDashboardPath: '', + externalDashboardUrl: '', }, + store, }); }); diff --git a/spec/javascripts/monitoring/helpers.js b/spec/javascripts/monitoring/helpers.js new file mode 100644 index 00000000000..672e3b948c4 --- /dev/null +++ b/spec/javascripts/monitoring/helpers.js @@ -0,0 +1,8 @@ +// eslint-disable-next-line import/prefer-default-export +export const resetStore = store => { + store.replaceState({ + showEmptyState: true, + emptyState: 'loading', + groups: [], + }); +}; diff --git a/spec/javascripts/monitoring/mock_data.js b/spec/javascripts/monitoring/mock_data.js index 6d4ef960c1a..d9d8cb66749 100644 --- a/spec/javascripts/monitoring/mock_data.js +++ b/spec/javascripts/monitoring/mock_data.js @@ -685,6 +685,47 @@ export const metricsGroupsAPIResponse = { last_update: '2017-05-25T13:18:34.949Z', }; +export const singleGroupResponse = [ + { + group: 'System metrics (Kubernetes)', + priority: 5, + metrics: [ + { + title: 'Memory Usage (Total)', + weight: 0, + y_label: 'Total Memory Used', + queries: [ + { + query_range: + 'avg(sum(container_memory_usage_bytes{container_name!="POD",pod_name=~"^production-(.*)",namespace="autodevops-deploy-33"}) by (job)) without (job) /1024/1024/1024', + unit: 'GB', + label: 'Total', + result: [ + { + metric: {}, + values: [ + [1558453960.079, '0.0357666015625'], + [1558454020.079, '0.035675048828125'], + [1558454080.079, '0.035152435302734375'], + [1558454140.079, '0.035221099853515625'], + [1558454200.079, '0.0352325439453125'], + [1558454260.079, '0.03479766845703125'], + [1558454320.079, '0.034793853759765625'], + [1558454380.079, '0.034931182861328125'], + [1558454440.079, '0.034816741943359375'], + [1558454500.079, '0.034816741943359375'], + [1558454560.079, '0.034816741943359375'], + ], + }, + ], + }, + ], + id: 15, + }, + ], + }, +]; + export default metricsGroupsAPIResponse; export const deploymentData = [ @@ -738,5836 +779,6 @@ export const statePaths = { documentationPath: '/help/administration/monitoring/prometheus/index.md', }; -export const singleRowMetricsMultipleSeries = [ - { - title: 'Multiple Time Series', - weight: 1, - y_label: 'Request Rates', - queries: [ - { - query_range: - 'sum(rate(nginx_responses_total{environment="production"}[2m])) by (status_code)', - label: 'Requests', - unit: 'Req/sec', - result: [ - { - metric: { - status_code: '1xx', - }, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '0', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '0', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '0', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '0', - }, - ], - }, - { - metric: { - status_code: '2xx', - }, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '1.3333460318669703', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '1.2952627669098458', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '1.3333079369916765', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '1.276190476190476', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '1.3333460318669703', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '1.3333587306424883', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '1.3142982314117277', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '1.333320635041571', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '1.31427319739812', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '1.2952504309564854', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '1.295225759754669', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '1.2571428571428571', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '1.580952380952381', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '1.7333333333333334', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '2.057142857142857', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '2.1904761904761902', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '1.8285714285714287', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '2.1142857142857143', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '1.619047619047619', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '1.2952504309564854', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '1.3333333333333333', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '1.314285714285714', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '1.295238095238095', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '1.7142857142857142', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '1.7333333333333334', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '1.3904761904761904', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '1.5047619047619047', - }, - ], - }, - ], - when: [ - { - value: 'hundred(s)', - color: 'green', - }, - ], - }, - ], - }, - { - title: 'Throughput', - weight: 1, - y_label: 'Requests / Sec', - queries: [ - { - query_range: - "sum(rate(nginx_requests_total{server_zone!='*', server_zone!='_', container_name!='POD',environment='production'}[2m]))", - label: 'Total', - unit: 'req / sec', - result: [ - { - metric: {}, - values: [ - { - time: '2017-08-27T11:01:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:02:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T11:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:07:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:14:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:18:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:21:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:32:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:34:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T11:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:39:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:41:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T11:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:43:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:45:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:46:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:47:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:48:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:49:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T11:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T11:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T11:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:01:51.462Z', - value: '0.49524281183630325', - }, - { - time: '2017-08-27T12:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:04:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:05:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T12:06:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:10:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:13:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:18:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:23:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:33:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:34:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:42:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:43:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:46:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:47:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:49:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:53:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T12:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:56:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T12:58:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T12:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:01:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T13:02:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:03:51.462Z', - value: '0.4761995466580315', - }, - { - time: '2017-08-27T13:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:06:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:14:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:15:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:16:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T13:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:22:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:23:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T13:24:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:32:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:34:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:35:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:41:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:43:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:46:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T13:47:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T13:48:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:49:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T13:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:51:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:52:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:53:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:54:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:55:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:56:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T13:57:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T13:58:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T13:59:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T14:00:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:01:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:16:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:17:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:18:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:19:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:21:51.462Z', - value: '0.4952286623111941', - }, - { - time: '2017-08-27T14:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:24:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:25:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:30:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:33:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T14:34:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:38:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:40:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:41:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:42:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:43:51.462Z', - value: '0.4666666666666667', - }, - { - time: '2017-08-27T14:44:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T14:45:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:46:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:47:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:49:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:51:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:53:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T14:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T14:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T14:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T14:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:04:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T15:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:08:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:09:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:10:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:11:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:12:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T15:13:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:20:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:22:51.462Z', - value: '0.49524281183630325', - }, - { - time: '2017-08-27T15:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:24:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:25:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:27:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:31:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:33:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:34:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:35:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:37:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:38:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:39:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:42:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:44:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:45:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:49:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T15:50:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:55:51.462Z', - value: '0.49524752852435283', - }, - { - time: '2017-08-27T15:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T15:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:58:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T15:59:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:00:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:01:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:03:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:04:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:05:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:07:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:08:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:09:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:12:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:15:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:16:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:17:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:18:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:19:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:24:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T16:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:26:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:27:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:29:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:30:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:32:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:34:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:36:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:42:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:44:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:45:51.462Z', - value: '0.485718911608682', - }, - { - time: '2017-08-27T16:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:48:51.462Z', - value: '0.4952333787297264', - }, - { - time: '2017-08-27T16:49:51.462Z', - value: '0.4857096599080009', - }, - { - time: '2017-08-27T16:50:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:51:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:53:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:55:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T16:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:57:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T16:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T16:59:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:02:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:03:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:04:51.462Z', - value: '0.47619501138106085', - }, - { - time: '2017-08-27T17:05:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:06:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:07:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:08:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:12:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:16:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:20:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:21:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:22:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:23:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:24:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:25:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:26:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:27:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:28:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:29:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T17:30:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:31:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:32:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:33:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:34:51.462Z', - value: '0.4761859410862754', - }, - { - time: '2017-08-27T17:35:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:36:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:37:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:38:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:41:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:42:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:43:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:44:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:45:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:46:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:47:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:48:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:49:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:50:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:51:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:52:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:53:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:54:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:55:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T17:56:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:57:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T17:58:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T17:59:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:00:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:01:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:02:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:03:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:04:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:05:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:06:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:07:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:08:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:09:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:10:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:11:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:12:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:13:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:14:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:15:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:16:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:17:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:18:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:19:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:20:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:21:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:22:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:23:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:24:51.462Z', - value: '0.45714285714285713', - }, - { - time: '2017-08-27T18:25:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:26:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:27:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:28:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:29:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:30:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:31:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:32:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:33:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:34:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:35:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:36:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:37:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:38:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:39:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:40:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:41:51.462Z', - value: '0.6190476190476191', - }, - { - time: '2017-08-27T18:42:51.462Z', - value: '0.6952380952380952', - }, - { - time: '2017-08-27T18:43:51.462Z', - value: '0.857142857142857', - }, - { - time: '2017-08-27T18:44:51.462Z', - value: '0.9238095238095239', - }, - { - time: '2017-08-27T18:45:51.462Z', - value: '0.7428571428571429', - }, - { - time: '2017-08-27T18:46:51.462Z', - value: '0.8857142857142857', - }, - { - time: '2017-08-27T18:47:51.462Z', - value: '0.638095238095238', - }, - { - time: '2017-08-27T18:48:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:49:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:50:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:51:51.462Z', - value: '0.47619501138106085', - }, - { - time: '2017-08-27T18:52:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:53:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:54:51.462Z', - value: '0.4952380952380952', - }, - { - time: '2017-08-27T18:55:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:56:51.462Z', - value: '0.4857142857142857', - }, - { - time: '2017-08-27T18:57:51.462Z', - value: '0.47619047619047616', - }, - { - time: '2017-08-27T18:58:51.462Z', - value: '0.6857142857142856', - }, - { - time: '2017-08-27T18:59:51.462Z', - value: '0.6952380952380952', - }, - { - time: '2017-08-27T19:00:51.462Z', - value: '0.5238095238095237', - }, - { - time: '2017-08-27T19:01:51.462Z', - value: '0.5904761904761905', - }, - ], - }, - ], - }, - ], - }, -]; - export const queryWithoutData = { title: 'HTTP Error rate', weight: 10, diff --git a/spec/javascripts/monitoring/monitoring_store_spec.js b/spec/javascripts/monitoring/monitoring_store_spec.js deleted file mode 100644 index 5bf6937c92e..00000000000 --- a/spec/javascripts/monitoring/monitoring_store_spec.js +++ /dev/null @@ -1,59 +0,0 @@ -import MonitoringStore from '~/monitoring/stores/monitoring_store'; -import MonitoringMock, { deploymentData, environmentData } from './mock_data'; - -describe('MonitoringStore', () => { - const store = new MonitoringStore(); - store.storeMetrics(MonitoringMock.data); - - it('contains two groups that contains, one of which has two queries sorted by priority', () => { - expect(store.groups).toBeDefined(); - expect(store.groups.length).toEqual(2); - expect(store.groups[0].metrics.length).toEqual(2); - }); - - it('gets the metrics count for every group', () => { - expect(store.getMetricsCount()).toEqual(3); - }); - - it('contains deployment data', () => { - store.storeDeploymentData(deploymentData); - - expect(store.deploymentData).toBeDefined(); - expect(store.deploymentData.length).toEqual(3); - expect(typeof store.deploymentData[0]).toEqual('object'); - }); - - it('only stores environment data that contains deployments', () => { - store.storeEnvironmentsData(environmentData); - - expect(store.environmentsData.length).toEqual(2); - }); - - it('removes the data if all the values from a query are not defined', () => { - expect(store.groups[1].metrics[0].queries[0].result.length).toEqual(0); - }); - - it('assigns queries a metric id', () => { - expect(store.groups[1].metrics[0].queries[0].metricId).toEqual('100'); - }); - - it('assigns metric id of null if metric has no id', () => { - const noId = MonitoringMock.data.map(group => ({ - ...group, - ...{ - metrics: group.metrics.map(metric => { - const { id, ...metricWithoutId } = metric; - - return metricWithoutId; - }), - }, - })); - store.storeMetrics(noId); - - store.groups.forEach(group => { - group.metrics.forEach(metric => { - expect(metric.queries.every(query => query.metricId === null)).toBe(true); - }); - }); - }); -}); diff --git a/spec/javascripts/monitoring/store/actions_spec.js b/spec/javascripts/monitoring/store/actions_spec.js new file mode 100644 index 00000000000..a848cd24fe3 --- /dev/null +++ b/spec/javascripts/monitoring/store/actions_spec.js @@ -0,0 +1,158 @@ +import axios from '~/lib/utils/axios_utils'; +import MockAdapter from 'axios-mock-adapter'; +import store from '~/monitoring/stores'; +import * as types from '~/monitoring/stores/mutation_types'; +import { + fetchDeploymentsData, + fetchEnvironmentsData, + requestMetricsData, + setEndpoints, + setGettingStartedEmptyState, +} from '~/monitoring/stores/actions'; +import storeState from '~/monitoring/stores/state'; +import testAction from 'spec/helpers/vuex_action_helper'; +import { resetStore } from '../helpers'; +import { deploymentData, environmentData } from '../mock_data'; + +describe('Monitoring store actions', () => { + let mock; + + beforeEach(() => { + mock = new MockAdapter(axios); + }); + + afterEach(() => { + resetStore(store); + mock.restore(); + }); + + describe('requestMetricsData', () => { + it('sets emptyState to loading', () => { + const commit = jasmine.createSpy(); + const { state } = store; + + requestMetricsData({ state, commit }); + + expect(commit).toHaveBeenCalledWith(types.REQUEST_METRICS_DATA); + }); + }); + + describe('fetchDeploymentsData', () => { + it('commits RECEIVE_DEPLOYMENTS_DATA_SUCCESS on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.deploymentEndpoint = '/success'; + + mock.onGet(state.deploymentEndpoint).reply(200, { + deployments: deploymentData, + }); + + fetchDeploymentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveDeploymentsDataSuccess', deploymentData); + done(); + }) + .catch(done.fail); + }); + + it('commits RECEIVE_DEPLOYMENTS_DATA_FAILURE on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.deploymentEndpoint = '/error'; + + mock.onGet(state.deploymentEndpoint).reply(500); + + fetchDeploymentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveDeploymentsDataFailure'); + done(); + }) + .catch(done.fail); + }); + }); + + describe('fetchEnvironmentsData', () => { + it('commits RECEIVE_ENVIRONMENTS_DATA_SUCCESS on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.environmentsEndpoint = '/success'; + + mock.onGet(state.environmentsEndpoint).reply(200, { + environments: environmentData, + }); + + fetchEnvironmentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveEnvironmentsDataSuccess', environmentData); + done(); + }) + .catch(done.fail); + }); + + it('commits RECEIVE_ENVIRONMENTS_DATA_FAILURE on error', done => { + const dispatch = jasmine.createSpy(); + const { state } = store; + state.environmentsEndpoint = '/error'; + + mock.onGet(state.environmentsEndpoint).reply(500); + + fetchEnvironmentsData({ state, dispatch }) + .then(() => { + expect(dispatch).toHaveBeenCalledWith('receiveEnvironmentsDataFailure'); + done(); + }) + .catch(done.fail); + }); + }); + + describe('Set endpoints', () => { + let mockedState; + + beforeEach(() => { + mockedState = storeState(); + }); + + it('should commit SET_ENDPOINTS mutation', done => { + testAction( + setEndpoints, + { + metricsEndpoint: 'additional_metrics.json', + deploymentsEndpoint: 'deployments.json', + environmentsEndpoint: 'deployments.json', + }, + mockedState, + [ + { + type: types.SET_ENDPOINTS, + payload: { + metricsEndpoint: 'additional_metrics.json', + deploymentsEndpoint: 'deployments.json', + environmentsEndpoint: 'deployments.json', + }, + }, + ], + [], + done, + ); + }); + }); + + describe('Set empty states', () => { + let mockedState; + + beforeEach(() => { + mockedState = storeState(); + }); + + it('should commit SET_METRICS_ENDPOINT mutation', done => { + testAction( + setGettingStartedEmptyState, + null, + mockedState, + [{ type: types.SET_GETTING_STARTED_EMPTY_STATE }], + [], + done, + ); + }); + }); +}); diff --git a/spec/javascripts/monitoring/store/mutations_spec.js b/spec/javascripts/monitoring/store/mutations_spec.js new file mode 100644 index 00000000000..882ee1dec14 --- /dev/null +++ b/spec/javascripts/monitoring/store/mutations_spec.js @@ -0,0 +1,92 @@ +import mutations from '~/monitoring/stores/mutations'; +import * as types from '~/monitoring/stores/mutation_types'; +import state from '~/monitoring/stores/state'; +import { metricsGroupsAPIResponse, deploymentData } from '../mock_data'; + +describe('Monitoring mutations', () => { + let stateCopy; + + beforeEach(() => { + stateCopy = state(); + }); + + describe(types.RECEIVE_METRICS_DATA_SUCCESS, () => { + beforeEach(() => { + stateCopy.groups = []; + const groups = metricsGroupsAPIResponse.data; + + mutations[types.RECEIVE_METRICS_DATA_SUCCESS](stateCopy, groups); + }); + + it('normalizes values', () => { + const expectedTimestamp = '2017-05-25T08:22:34.925Z'; + const expectedValue = 0.0010794445585559514; + const [timestamp, value] = stateCopy.groups[0].metrics[0].queries[0].result[0].values[0]; + + expect(timestamp).toEqual(expectedTimestamp); + expect(value).toEqual(expectedValue); + }); + + it('contains two groups that contains, one of which has two queries sorted by priority', () => { + expect(stateCopy.groups).toBeDefined(); + expect(stateCopy.groups.length).toEqual(2); + expect(stateCopy.groups[0].metrics.length).toEqual(2); + }); + + it('assigns queries a metric id', () => { + expect(stateCopy.groups[1].metrics[0].queries[0].metricId).toEqual('100'); + }); + + it('removes the data if all the values from a query are not defined', () => { + expect(stateCopy.groups[1].metrics[0].queries[0].result.length).toEqual(0); + }); + + it('assigns metric id of null if metric has no id', () => { + stateCopy.groups = []; + const groups = metricsGroupsAPIResponse.data; + const noId = groups.map(group => ({ + ...group, + ...{ + metrics: group.metrics.map(metric => { + const { id, ...metricWithoutId } = metric; + + return metricWithoutId; + }), + }, + })); + + mutations[types.RECEIVE_METRICS_DATA_SUCCESS](stateCopy, noId); + + stateCopy.groups.forEach(group => { + group.metrics.forEach(metric => { + expect(metric.queries.every(query => query.metricId === null)).toBe(true); + }); + }); + }); + }); + + describe(types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS, () => { + it('stores the deployment data', () => { + stateCopy.deploymentData = []; + mutations[types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS](stateCopy, deploymentData); + + expect(stateCopy.deploymentData).toBeDefined(); + expect(stateCopy.deploymentData.length).toEqual(3); + expect(typeof stateCopy.deploymentData[0]).toEqual('object'); + }); + }); + + describe('SET_ENDPOINTS', () => { + it('should set all the endpoints', () => { + mutations[types.SET_ENDPOINTS](stateCopy, { + metricsEndpoint: 'additional_metrics.json', + environmentsEndpoint: 'environments.json', + deploymentsEndpoint: 'deployments.json', + }); + + expect(stateCopy.metricsEndpoint).toEqual('additional_metrics.json'); + expect(stateCopy.environmentsEndpoint).toEqual('environments.json'); + expect(stateCopy.deploymentsEndpoint).toEqual('deployments.json'); + }); + }); +}); diff --git a/spec/javascripts/notes/components/note_actions_spec.js b/spec/javascripts/notes/components/note_actions_spec.js index 0cfcc994234..2159e4ddf16 100644 --- a/spec/javascripts/notes/components/note_actions_spec.js +++ b/spec/javascripts/notes/components/note_actions_spec.js @@ -58,6 +58,7 @@ describe('noteActions', () => { it('should render emoji link', () => { expect(wrapper.find('.js-add-award').exists()).toBe(true); + expect(wrapper.find('.js-add-award').attributes('data-position')).toBe('right'); }); describe('actions dropdown', () => { diff --git a/spec/javascripts/notes/components/note_app_spec.js b/spec/javascripts/notes/components/note_app_spec.js deleted file mode 100644 index ef876dc2941..00000000000 --- a/spec/javascripts/notes/components/note_app_spec.js +++ /dev/null @@ -1,331 +0,0 @@ -import $ from 'jquery'; -import _ from 'underscore'; -import Vue from 'vue'; -import { mount, createLocalVue } from '@vue/test-utils'; -import NotesApp from '~/notes/components/notes_app.vue'; -import service from '~/notes/services/notes_service'; -import createStore from '~/notes/stores'; -import '~/behaviors/markdown/render_gfm'; -import * as mockData from '../mock_data'; - -describe('note_app', () => { - let mountComponent; - let wrapper; - let store; - - beforeEach(() => { - $('body').attr('data-page', 'projects:merge_requests:show'); - - store = createStore(); - mountComponent = data => { - const propsData = data || { - noteableData: mockData.noteableDataMock, - notesData: mockData.notesDataMock, - userData: mockData.userDataMock, - }; - const localVue = createLocalVue(); - - return mount( - { - components: { - NotesApp, - }, - template: '<div class="js-vue-notes-event"><notes-app v-bind="$attrs" /></div>', - }, - { - propsData, - store, - localVue, - sync: false, - }, - ); - }; - }); - - afterEach(() => { - wrapper.destroy(); - }); - - describe('set data', () => { - const responseInterceptor = (request, next) => { - next( - request.respondWith(JSON.stringify([]), { - status: 200, - }), - ); - }; - - beforeEach(() => { - Vue.http.interceptors.push(responseInterceptor); - wrapper = mountComponent(); - }); - - afterEach(() => { - Vue.http.interceptors = _.without(Vue.http.interceptors, responseInterceptor); - }); - - it('should set notes data', () => { - expect(store.state.notesData).toEqual(mockData.notesDataMock); - }); - - it('should set issue data', () => { - expect(store.state.noteableData).toEqual(mockData.noteableDataMock); - }); - - it('should set user data', () => { - expect(store.state.userData).toEqual(mockData.userDataMock); - }); - - it('should fetch discussions', () => { - expect(store.state.discussions).toEqual([]); - }); - }); - - describe('render', () => { - beforeEach(() => { - setFixtures('<div class="js-discussions-count"></div>'); - - Vue.http.interceptors.push(mockData.individualNoteInterceptor); - wrapper = mountComponent(); - }); - - afterEach(() => { - Vue.http.interceptors = _.without(Vue.http.interceptors, mockData.individualNoteInterceptor); - }); - - it('should render list of notes', done => { - const note = - mockData.INDIVIDUAL_NOTE_RESPONSE_MAP.GET[ - '/gitlab-org/gitlab-ce/issues/26/discussions.json' - ][0].notes[0]; - - setTimeout(() => { - expect( - wrapper - .find('.main-notes-list .note-header-author-name') - .text() - .trim(), - ).toEqual(note.author.name); - - expect(wrapper.find('.main-notes-list .note-text').html()).toContain(note.note_html); - done(); - }, 0); - }); - - it('should render form', () => { - expect(wrapper.find('.js-main-target-form').name()).toEqual('form'); - expect(wrapper.find('.js-main-target-form textarea').attributes('placeholder')).toEqual( - 'Write a comment or drag your files here…', - ); - }); - - it('should not render form when commenting is disabled', () => { - store.state.commentsDisabled = true; - wrapper = mountComponent(); - - expect(wrapper.find('.js-main-target-form').exists()).toBe(false); - }); - - it('should render discussion filter note `commentsDisabled` is true', () => { - store.state.commentsDisabled = true; - wrapper = mountComponent(); - - expect(wrapper.find('.js-discussion-filter-note').exists()).toBe(true); - }); - - it('should render form comment button as disabled', () => { - expect(wrapper.find('.js-note-new-discussion').attributes('disabled')).toEqual('disabled'); - }); - - it('updates discussions badge', done => { - setTimeout(() => { - expect(document.querySelector('.js-discussions-count').textContent).toEqual('2'); - - done(); - }); - }); - }); - - describe('while fetching data', () => { - beforeEach(() => { - wrapper = mountComponent(); - }); - - it('renders skeleton notes', () => { - expect(wrapper.find('.animation-container').exists()).toBe(true); - }); - - it('should render form', () => { - expect(wrapper.find('.js-main-target-form').name()).toEqual('form'); - expect(wrapper.find('.js-main-target-form textarea').attributes('placeholder')).toEqual( - 'Write a comment or drag your files here…', - ); - }); - }); - - describe('update note', () => { - describe('individual note', () => { - beforeEach(done => { - Vue.http.interceptors.push(mockData.individualNoteInterceptor); - spyOn(service, 'updateNote').and.callThrough(); - wrapper = mountComponent(); - setTimeout(() => { - wrapper.find('.js-note-edit').trigger('click'); - Vue.nextTick(done); - }, 0); - }); - - afterEach(() => { - Vue.http.interceptors = _.without( - Vue.http.interceptors, - mockData.individualNoteInterceptor, - ); - }); - - it('renders edit form', () => { - expect(wrapper.find('.js-vue-issue-note-form').exists()).toBe(true); - }); - - it('calls the service to update the note', done => { - wrapper.find('.js-vue-issue-note-form').value = 'this is a note'; - wrapper.find('.js-vue-issue-save').trigger('click'); - - expect(service.updateNote).toHaveBeenCalled(); - // Wait for the requests to finish before destroying - setTimeout(() => { - done(); - }); - }); - }); - - describe('discussion note', () => { - beforeEach(done => { - Vue.http.interceptors.push(mockData.discussionNoteInterceptor); - spyOn(service, 'updateNote').and.callThrough(); - wrapper = mountComponent(); - - setTimeout(() => { - wrapper.find('.js-note-edit').trigger('click'); - Vue.nextTick(done); - }, 0); - }); - - afterEach(() => { - Vue.http.interceptors = _.without( - Vue.http.interceptors, - mockData.discussionNoteInterceptor, - ); - }); - - it('renders edit form', () => { - expect(wrapper.find('.js-vue-issue-note-form').exists()).toBe(true); - }); - - it('updates the note and resets the edit form', done => { - wrapper.find('.js-vue-issue-note-form').value = 'this is a note'; - wrapper.find('.js-vue-issue-save').trigger('click'); - - expect(service.updateNote).toHaveBeenCalled(); - // Wait for the requests to finish before destroying - setTimeout(() => { - done(); - }); - }); - }); - }); - - describe('new note form', () => { - beforeEach(() => { - wrapper = mountComponent(); - }); - - it('should render markdown docs url', () => { - const { markdownDocsPath } = mockData.notesDataMock; - - expect( - wrapper - .find(`a[href="${markdownDocsPath}"]`) - .text() - .trim(), - ).toEqual('Markdown'); - }); - - it('should render quick action docs url', () => { - const { quickActionsDocsPath } = mockData.notesDataMock; - - expect( - wrapper - .find(`a[href="${quickActionsDocsPath}"]`) - .text() - .trim(), - ).toEqual('quick actions'); - }); - }); - - describe('edit form', () => { - beforeEach(() => { - Vue.http.interceptors.push(mockData.individualNoteInterceptor); - wrapper = mountComponent(); - }); - - afterEach(() => { - Vue.http.interceptors = _.without(Vue.http.interceptors, mockData.individualNoteInterceptor); - }); - - it('should render markdown docs url', done => { - setTimeout(() => { - wrapper.find('.js-note-edit').trigger('click'); - const { markdownDocsPath } = mockData.notesDataMock; - - Vue.nextTick(() => { - expect( - wrapper - .find(`.edit-note a[href="${markdownDocsPath}"]`) - .text() - .trim(), - ).toEqual('Markdown is supported'); - done(); - }); - }, 0); - }); - - it('should not render quick actions docs url', done => { - setTimeout(() => { - wrapper.find('.js-note-edit').trigger('click'); - const { quickActionsDocsPath } = mockData.notesDataMock; - - Vue.nextTick(() => { - expect(wrapper.find(`.edit-note a[href="${quickActionsDocsPath}"]`).exists()).toBe(false); - done(); - }); - }, 0); - }); - }); - - describe('emoji awards', () => { - it('dispatches toggleAward after toggleAward event', () => { - const toggleAwardEvent = new CustomEvent('toggleAward', { - detail: { - awardName: 'test', - noteId: 1, - }, - }); - const toggleAwardAction = jasmine.createSpy('toggleAward'); - wrapper.vm.$store.hotUpdate({ - actions: { - toggleAward: toggleAwardAction, - }, - }); - - wrapper.vm.$parent.$el.dispatchEvent(toggleAwardEvent); - - expect(toggleAwardAction).toHaveBeenCalledTimes(1); - const [, payload] = toggleAwardAction.calls.argsFor(0); - - expect(payload).toEqual({ - awardName: 'test', - noteId: 1, - }); - }); - }); -}); diff --git a/spec/javascripts/pipelines/mock_data.js b/spec/javascripts/pipelines/mock_data.js index 03ead6cd8ba..8eef9166b8d 100644 --- a/spec/javascripts/pipelines/mock_data.js +++ b/spec/javascripts/pipelines/mock_data.js @@ -1,5 +1,6 @@ export const pipelineWithStages = { id: 20333396, + iid: 304399, user: { id: 128633, name: 'Rémy Coutable', diff --git a/spec/javascripts/pipelines/pipeline_url_spec.js b/spec/javascripts/pipelines/pipeline_url_spec.js index aa196af2f33..88c0137dc58 100644 --- a/spec/javascripts/pipelines/pipeline_url_spec.js +++ b/spec/javascripts/pipelines/pipeline_url_spec.js @@ -13,6 +13,7 @@ describe('Pipeline Url Component', () => { propsData: { pipeline: { id: 1, + iid: 1, path: 'foo', flags: {}, }, @@ -28,6 +29,7 @@ describe('Pipeline Url Component', () => { propsData: { pipeline: { id: 1, + iid: 1, path: 'foo', flags: {}, }, @@ -47,6 +49,7 @@ describe('Pipeline Url Component', () => { propsData: { pipeline: { id: 1, + iid: 1, path: 'foo', flags: { latest: true, @@ -78,6 +81,7 @@ describe('Pipeline Url Component', () => { propsData: { pipeline: { id: 1, + iid: 1, path: 'foo', flags: { latest: true, @@ -100,6 +104,7 @@ describe('Pipeline Url Component', () => { propsData: { pipeline: { id: 1, + iid: 1, path: 'foo', flags: { failure_reason: true, diff --git a/spec/javascripts/projects/project_new_spec.js b/spec/javascripts/projects/project_new_spec.js index b61e0ac872f..106a3ba94e4 100644 --- a/spec/javascripts/projects/project_new_spec.js +++ b/spec/javascripts/projects/project_new_spec.js @@ -10,7 +10,17 @@ describe('New Project', () => { setFixtures(` <div class='toggle-import-form'> <div class='import-url-data'> - <input id="project_import_url" /> + <div class="form-group"> + <input id="project_import_url" /> + </div> + <div id="import-url-auth-method"> + <div class="form-group"> + <input id="project-import-url-user" /> + </div> + <div class="form-group"> + <input id="project_import_url_password" /> + </div> + </div> <input id="project_name" /> <input id="project_path" /> </div> @@ -119,7 +129,7 @@ describe('New Project', () => { }); it('changes project path for HTTPS URL in $projectImportUrl', () => { - $projectImportUrl.val('https://username:password@gitlab.company.com/group/project.git'); + $projectImportUrl.val('https://gitlab.company.com/group/project.git'); projectNew.deriveProjectPathFromUrl($projectImportUrl); diff --git a/spec/javascripts/test_bundle.js b/spec/javascripts/test_bundle.js index 87ef0885d8c..8c80a425581 100644 --- a/spec/javascripts/test_bundle.js +++ b/spec/javascripts/test_bundle.js @@ -111,7 +111,7 @@ let longRunningTestTimeoutHandle; beforeEach(done => { longRunningTestTimeoutHandle = setTimeout(() => { done.fail('Test is running too long!'); - }, 2000); + }, 4000); done(); }); diff --git a/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js b/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js index 75017d20473..a2308b0dfdb 100644 --- a/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js +++ b/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js @@ -103,7 +103,7 @@ describe('MRWidgetPipeline', () => { it('should render pipeline ID', () => { expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual( - `#${mockData.pipeline.id}`, + `#${mockData.pipeline.id} (#${mockData.pipeline.iid})`, ); }); @@ -150,7 +150,7 @@ describe('MRWidgetPipeline', () => { it('should render pipeline ID', () => { expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual( - `#${mockData.pipeline.id}`, + `#${mockData.pipeline.id} (#${mockData.pipeline.iid})`, ); }); @@ -222,9 +222,9 @@ describe('MRWidgetPipeline', () => { sourceBranchLink: mockCopy.source_branch_link, }); - const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ - pipeline.commit.short_id - } on ${mockCopy.source_branch_link}`; + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${ + pipeline.details.status.label + } for ${pipeline.commit.short_id} on ${mockCopy.source_branch_link}`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); @@ -247,11 +247,11 @@ describe('MRWidgetPipeline', () => { sourceBranchLink: mockCopy.source_branch_link, }); - const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ - pipeline.commit.short_id - } on !${pipeline.merge_request.iid} with ${pipeline.merge_request.source_branch} into ${ - pipeline.merge_request.target_branch - }`; + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${ + pipeline.details.status.label + } for ${pipeline.commit.short_id} on !${pipeline.merge_request.iid} with ${ + pipeline.merge_request.source_branch + } into ${pipeline.merge_request.target_branch}`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); @@ -274,9 +274,11 @@ describe('MRWidgetPipeline', () => { sourceBranchLink: mockCopy.source_branch_link, }); - const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ - pipeline.commit.short_id - } on !${pipeline.merge_request.iid} with ${pipeline.merge_request.source_branch}`; + const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${ + pipeline.details.status.label + } for ${pipeline.commit.short_id} on !${pipeline.merge_request.iid} with ${ + pipeline.merge_request.source_branch + }`; const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); diff --git a/spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js b/spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js index b9718a78fa4..8e0415b813b 100644 --- a/spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js +++ b/spec/javascripts/vue_mr_widget/components/states/mr_widget_merge_when_pipeline_succeeds_spec.js @@ -21,7 +21,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => { canCancelAutomaticMerge: true, mergeUserId: 1, currentUserId: 1, - setToMWPSBy: {}, + setToAutoMergeBy: {}, sha, targetBranchPath, targetBranch, @@ -106,7 +106,7 @@ describe('MRWidgetMergeWhenPipelineSucceeds', () => { expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested'); expect(vm.service.merge).toHaveBeenCalledWith({ sha, - merge_when_pipeline_succeeds: true, + auto_merge_strategy: 'merge_when_pipeline_succeeds', should_remove_source_branch: true, }); done(); diff --git a/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js b/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js index 368c997d318..3ae773b6ccb 100644 --- a/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js +++ b/spec/javascripts/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js @@ -80,7 +80,7 @@ describe('ReadyToMerge', () => { it('should have default data', () => { expect(vm.mergeWhenBuildSucceeds).toBeFalsy(); expect(vm.useCommitMessageWithDescription).toBeFalsy(); - expect(vm.setToMergeWhenPipelineSucceeds).toBeFalsy(); + expect(vm.autoMergeStrategy).toBeUndefined(); expect(vm.showCommitMessageEditor).toBeFalsy(); expect(vm.isMakingRequest).toBeFalsy(); expect(vm.isMergingImmediately).toBeFalsy(); @@ -91,17 +91,17 @@ describe('ReadyToMerge', () => { }); describe('computed', () => { - describe('shouldShowMergeWhenPipelineSucceedsText', () => { + describe('shouldShowAutoMergeText', () => { it('should return true with active pipeline', () => { vm.mr.isPipelineActive = true; - expect(vm.shouldShowMergeWhenPipelineSucceedsText).toBeTruthy(); + expect(vm.shouldShowAutoMergeText).toBeTruthy(); }); it('should return false with inactive pipeline', () => { vm.mr.isPipelineActive = false; - expect(vm.shouldShowMergeWhenPipelineSucceedsText).toBeFalsy(); + expect(vm.shouldShowAutoMergeText).toBeFalsy(); }); }); @@ -325,16 +325,20 @@ describe('ReadyToMerge', () => { vm.handleMergeButtonClick(true); setTimeout(() => { - expect(vm.setToMergeWhenPipelineSucceeds).toBeTruthy(); + expect(vm.autoMergeStrategy).toBe('merge_when_pipeline_succeeds'); expect(vm.isMakingRequest).toBeTruthy(); expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested'); const params = vm.service.merge.calls.argsFor(0)[0]; - expect(params.sha).toEqual(vm.mr.sha); - expect(params.commit_message).toEqual(vm.mr.commitMessage); - expect(params.should_remove_source_branch).toBeFalsy(); - expect(params.merge_when_pipeline_succeeds).toBeTruthy(); + expect(params).toEqual( + jasmine.objectContaining({ + sha: vm.mr.sha, + commit_message: vm.mr.commitMessage, + should_remove_source_branch: false, + auto_merge_strategy: 'merge_when_pipeline_succeeds', + }), + ); done(); }, 333); }); @@ -345,7 +349,7 @@ describe('ReadyToMerge', () => { vm.handleMergeButtonClick(false, true); setTimeout(() => { - expect(vm.setToMergeWhenPipelineSucceeds).toBeFalsy(); + expect(vm.autoMergeStrategy).toBeUndefined(); expect(vm.isMakingRequest).toBeTruthy(); expect(eventHub.$emit).toHaveBeenCalledWith('FailedToMerge', undefined); @@ -363,7 +367,7 @@ describe('ReadyToMerge', () => { vm.handleMergeButtonClick(); setTimeout(() => { - expect(vm.setToMergeWhenPipelineSucceeds).toBeFalsy(); + expect(vm.autoMergeStrategy).toBeUndefined(); expect(vm.isMakingRequest).toBeTruthy(); expect(vm.initiateMergePolling).toHaveBeenCalled(); diff --git a/spec/javascripts/vue_mr_widget/mock_data.js b/spec/javascripts/vue_mr_widget/mock_data.js index bec16b0aab0..edbd0d54151 100644 --- a/spec/javascripts/vue_mr_widget/mock_data.js +++ b/spec/javascripts/vue_mr_widget/mock_data.js @@ -62,6 +62,7 @@ export default { "Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22", pipeline: { id: 172, + iid: 32, user: { name: 'Administrator', username: 'root', @@ -241,6 +242,8 @@ export default { export const mockStore = { pipeline: { id: 0, + iid: 0, + path: '/root/acets-app/pipelines/0', details: { status: { details_path: '/root/review-app-tester/pipelines/66', @@ -258,6 +261,8 @@ export const mockStore = { }, mergePipeline: { id: 1, + iid: 1, + path: '/root/acets-app/pipelines/0', details: { status: { details_path: '/root/review-app-tester/pipelines/66', diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js index a0628fdcebe..918717c4547 100644 --- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js +++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js @@ -21,7 +21,6 @@ describe('mrWidgetOptions', () => { const COLLABORATION_MESSAGE = 'Allows commits from members who can merge to the target branch'; beforeEach(() => { - gon.features = { approvalRules: false }; // Prevent component mounting delete mrWidgetOptions.el; @@ -32,7 +31,6 @@ describe('mrWidgetOptions', () => { }); afterEach(() => { - gon.features = null; vm.$destroy(); }); @@ -600,6 +598,7 @@ describe('mrWidgetOptions', () => { ]; const deploymentMockData = { id: 15, + iid: 7, name: 'review/diplo', url: '/root/acets-review-apps/environments/15', stop_url: '/root/acets-review-apps/environments/15/stop', @@ -646,6 +645,7 @@ describe('mrWidgetOptions', () => { vm.mr.state = 'merged'; vm.mr.mergePipeline = { id: 127, + iid: 35, user: { id: 1, name: 'Administrator', |
