Skip to content

Commit

Permalink
[TIMOB-25728] Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Feb 15, 2018
1 parent 3e3c049 commit 10af1dd
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/Resources/ti.ui.tableview.addontest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Appcelerator Titanium Mobile
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Ti */
/* eslint no-unused-expressions: "off" */
'use strict';
var should = require('./utilities/assertions');

describe('Ti.UI.TableView', function () {
it('set and clear data', function () {
var data_a = [
{ title: 'Square', backgroundSelectedColor: 'red' },
{ title: 'Circle', backgroundSelectedColor: 'blue' },
{ title: 'Triangle', backgroundSelectedColor: 'purple' }
],
data_b = [
{ title: 'Red', backgroundSelectedColor: 'red' },
{ title: 'Green', backgroundSelectedColor: 'green' },
{ title: 'Blue', backgroundSelectedColor: 'blue' }
],
tv = Ti.UI.createTableView(),
error;

try {
tv.data = [];
tv.setData(data_a);
tv.data = [];
tv.setData(data_b);
tv.data = [];
tv.setData(data_a);
} catch (e) {
error = e;
}
finish(error);
});
});

0 comments on commit 10af1dd

Please sign in to comment.