Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5A99D458 for ; Tue, 13 Nov 2012 19:13:43 +0000 (UTC) Received: (qmail 20973 invoked by uid 500); 13 Nov 2012 19:13:43 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 20914 invoked by uid 500); 13 Nov 2012 19:13:43 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 20604 invoked by uid 500); 13 Nov 2012 19:13:43 -0000 Delivered-To: apmail-incubator-callback-commits@incubator.apache.org Received: (qmail 20550 invoked by uid 99); 13 Nov 2012 19:13:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2012 19:13:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AF56E559AB; Tue, 13 Nov 2012 19:13:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gtanner@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [11/16] js commit: webworks notification tests Message-Id: <20121113191342.AF56E559AB@tyr.zones.apache.org> Date: Tue, 13 Nov 2012 19:13:42 +0000 (UTC) webworks notification tests Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/82dc004f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/82dc004f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/82dc004f Branch: refs/heads/master Commit: 82dc004f06de702ff4d480800f3eaf5dbd18085a Parents: 2db5e4e Author: Matt Lantz Authored: Wed Nov 7 17:34:40 2012 -0500 Committer: Gord Tanner Committed: Mon Nov 12 09:42:28 2012 -0500 ---------------------------------------------------------------------- test/blackberry/webworks/test.notification.js | 80 ++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/82dc004f/test/blackberry/webworks/test.notification.js ---------------------------------------------------------------------- diff --git a/test/blackberry/webworks/test.notification.js b/test/blackberry/webworks/test.notification.js new file mode 100644 index 0000000..75c7102 --- /dev/null +++ b/test/blackberry/webworks/test.notification.js @@ -0,0 +1,80 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +describe("notification", function () { + var notification = require('cordova/plugin/webworks/notification'), + exec = require('cordova/exec'); + + // alerts handled by cordova + describe("alert - arguments not equal to three", function() { + it("should provide an alert notification", function() { + + var args = "Danger, danger Will Robinson!", + n = notification.alert(args); + + expect(args.length).not.toBe(3); + expect(n.status).toBe(9); + expect(n.message).toBe('Notification action - alert arguments not found'); + }); + }); + + // alerts handled by webworks + describe("alert - arguments equal to three", function() { + it("should call blackberry.ui.dialog.customAskAsync", function() { + + // spyOn(blackberry.ui.dialog.customAskAsync, "apply"); + + // var args = ["Danger, danger Will Robinson", "Panic, is my middle name", "PANIC"], + // n = notification.alert(args); + + + // expect(args.length).toBe(3); + // expect(n.status).toBe(9); + // expect(n.message).toBe('Notification action - alert arguments not found'); + + }); + }); + + // confirm handled by cordova + describe("confirm - arguments not equal to three", function() { + it("should provide a confirm notification", function() { + + var args = "Are you sure you're ready to jump?", + n = notification.confirm(args); + + expect(args.length).not.toBe(3); + expect(n.status).toBe(9); + expect(n.message).toBe('Notification action - confirm arguments not found'); + }); + }); + + // confirm handled by webworks + describe("alert - arguments equal to three", function() { + it("should call blackberry", function() { + + // var args = ["Danger, danger Will Robinson", "Panic, is my middle name", "PANIC"]; + // var n = notification.alert(args); + // TALK TO GORD!!!!! + + }); + }); + +});