Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Workspace/apps/admin-dashboard/app/data/dashboard/Tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ Ext.define('Admin.data.dashboard.Tasks', {
"id": 3,
"task": "Upgrade to SSD harddisks",
"done": false
},
{
"id": 4,
"task": "Pay server invoice",
"done": false
},
{
"id": 5,
"task": "Upgrade to SSD harddisks",
"done": false
}
]
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ Ext.define('Admin.view.dashboard.DashboardController', {
tool.toggleValue = !tool.toggleValue;
},

onAddTodo : function() {
var store = this.getStore('todos');
var task = Ext.getCmp('new-task-text');
var newTask = task.getValue();
store.add( { task: newTask } );
task.setValue('');
},

clearChartUpdates : function() {
this.chartTaskRunner = Ext.destroy(this.chartTaskRunner);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Ext.define('Admin.view.dashboard.Todos', {
xtype: 'textfield',
flex: 1,
fieldLabel: 'Add Task',
id: 'new-task-text',
hideLabel: true,
width:540,
emptyText: 'Add New Task'
Expand All @@ -55,6 +56,9 @@ Ext.define('Admin.view.dashboard.Todos', {
xtype: 'button',
ui: 'soft-green',
width: 40,
listeners: {
click: 'onAddTodo'
},
iconCls: 'x-fa fa-plus',
margin:'0 0 0 10'
}
Expand Down
13 changes: 12 additions & 1 deletion Workspace/apps/admin-dashboard/test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"coverageFilters": [],
"directory": "unit",
"name": "Unit Tests",
"profile": "classic"
"profile": "classic",
"launch": false,
"page": ""
},
{
"libs": [],
Expand All @@ -18,6 +20,15 @@
"page": "#email",
"launch": true,
"profile": "classic"
},
{
"libs": [],
"coverageFilters": [],
"launch": true,
"directory": "todo",
"name": "Todo",
"page": "",
"profile": "classic"
}
],
"globals": "Admin"
Expand Down
26 changes: 26 additions & 0 deletions Workspace/apps/admin-dashboard/test/todo/New todo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
describe("New todo", function() {
it("should pass", function() {
expect(1).toBe(1);
});
it('should appear in list', function() {
ST.play([
{ type: "tap", target: "@new-task-text-inputEl", x: 41, y: 8 },
{ type: "keydown", target: "@new-task-text-inputEl", key: "Shift", shiftKey: true },
{ type: "keydown", target: "@new-task-text-inputEl", key: "T", shiftKey: true },
{ type: "keyup", target: "@new-task-text-inputEl", key: "T", shiftKey: true },
{ type: "keyup", target: "@new-task-text-inputEl", key: "Shift" },
{ type: "type", target: "@new-task-text-inputEl", text: "est new functionality" },
{ type: "tap", target: "@button-1080-btnIconEl", x: 12, y: -1 },
{ fn: function(done) {
expect(this.targetEl.dom.innerHTML).toBe('Test new functionality');
done();
}, target: "@tableview-1078-record-95/tbody/tr/td[2]/div", x: 250, y: 17 }
]);

});
it('should clear new task field', function() {
var fld = ST.find('#new-task-text => input');
expect(fld.value.length).toBe(0);
});
});