]>
git.proxmox.com Git - extjs.git/blob - extjs/packages/core/test/specs/data/field/String.js
1 describe("Ext.data.field.String", function() {
6 field
= new Ext
.data
.field
.String(cfg
);
10 return field
.convert(v
);
13 afterEach(function() {
17 describe("defaults", function() {
18 it("should configure the type", function() {
20 expect(field
.getType()).toBe('string');
24 describe("convert", function() {
25 describe("with allowNull: true", function() {
26 beforeEach(function() {
32 it("should return null with undefined", function() {
33 expect(c(undefined)).toBeNull();
36 it("should return null with null", function() {
37 expect(c(null)).toBeNull();
41 describe("with allowNull: false", function() {
42 beforeEach(function() {
48 it("should return '' with undefined", function() {
49 expect(c(undefined)).toBe('');
52 it("should return null with null", function() {
53 expect(c(null)).toBe('');
57 it("should return a stringified bool", function() {
59 expect(c(true)).toBe('true');
62 it("should return a stringified number", function() {
64 expect(c(2)).toBe('2');
67 it("should return a string", function() {
69 expect(c('foo')).toBe('foo');