/*! grafana - v4.5.1 - 2017-09-19
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

define(["app/features/dashboard/viewStateSrv","app/core/config"],function(a,b){"use strict";describe("when updating view state",function(){var a,c,d={},e={},f={user:{orgId:19}};beforeEach(function(){b.bootData={user:{orgId:1}}}),beforeEach(module("grafana.services")),beforeEach(module(function(a){a.value("timeSrv",d),a.value("templateSrv",e),a.value("contextSrv",f)})),beforeEach(inject(function(b,d,e){e.onAppEvent=function(){},e.dashboard={meta:{}},a=b.create(e),c=d})),describe("to fullscreen true and edit true",function(){it("should update querystring and view state",function(){var b={fullscreen:!0,edit:!0,panelId:1};a.update(b),expect(c.search()).to.eql({fullscreen:!0,edit:!0,panelId:1,orgId:1}),expect(a.dashboard.meta.fullscreen).to.be(!0),expect(a.state.fullscreen).to.be(!0)})}),describe("to fullscreen false",function(){it("should remove params from query string",function(){a.update({fullscreen:!0,panelId:1,edit:!0}),a.update({fullscreen:!1}),expect(a.dashboard.meta.fullscreen).to.be(!1),expect(a.state.fullscreen).to.be(null)})})})});