/*! grafana - v3.1.0 - 2016-07-18
 * Copyright (c) 2016 Torkel Ödegaard; Licensed Apache-2.0 */

define(["app/features/dashboard/viewStateSrv"],function(){"use strict";describe("when updating view state",function(){var a,b,c={},d={},e={user:{orgId:19}};beforeEach(module("grafana.services")),beforeEach(module(function(a){a.value("timeSrv",c),a.value("templateSrv",d),a.value("contextSrv",e)})),beforeEach(inject(function(c,d,e){e.onAppEvent=function(){},e.dashboard={meta:{}},a=c.create(e),b=d})),describe("to fullscreen true and edit true",function(){it("should update querystring and view state",function(){var c={fullscreen:!0,edit:!0,panelId:1};a.update(c),expect(b.search()).to.eql({fullscreen:!0,edit:!0,panelId: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)})})})});