1 describe("Ext.data.proxy.LocalStorage", function() {
4 if (Ext
.supports
.LocalStorage
) {
5 beforeEach(function() {
6 Ext
.ClassManager
.enableNamespaceParseCache
= false;
7 proxy
= new Ext
.data
.proxy
.LocalStorage({id
: 1});
10 afterEach(function() {
11 Ext
.ClassManager
.enableNamespaceParseCache
= true;
14 describe("instantiation", function() {
15 it("should extend Ext.data.proxy.WebStorage", function() {
16 expect(proxy
.superclass
).toEqual(Ext
.data
.proxy
.WebStorage
.prototype);
20 describe("methods", function() {
21 describe("getStorageObject", function() {
22 it("should return localStorage object", function() {
23 // IE8 throw Class doesn't support Automation when comparing localStorage to itself (or sessionStorage)
24 var automationBug
= false;
26 localStorage
=== localStorage
;
31 expect(proxy
.getStorageObject()).toEqual(localStorage
);
33 var storageObject
= proxy
.getStorageObject();
34 expect(window
.localStorage
.setItem
=== storageObject
.setItem
).toBe(true);
40 describe("instantiation", function() {
41 it("should throw an error", function() {
43 new Ext
.data
.proxy
.LocalStorage({id
: 1});
44 }).toRaiseExtError("Local Storage is not supported in this browser, please use another type of data proxy");