You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/07/26 06:46:12 UTC

[09/12] incubator-weex git commit: + [html5] add navigator unit test case

+ [html5] add navigator unit test case


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ea3546b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ea3546b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ea3546b9

Branch: refs/heads/0.16-dev
Commit: ea3546b969d4b9e4a02417cc00b7c655cdb6e4eb
Parents: 0a02f23
Author: erha19 <fa...@gmail.com>
Authored: Tue Jul 25 21:16:07 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Tue Jul 25 21:16:07 2017 +0800

----------------------------------------------------------------------
 html5/test/render/vue/modules/navigator.js | 42 +++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ea3546b9/html5/test/render/vue/modules/navigator.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/modules/navigator.js b/html5/test/render/vue/modules/navigator.js
new file mode 100644
index 0000000..c82d064
--- /dev/null
+++ b/html5/test/render/vue/modules/navigator.js
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+/*global Event*/
+import * as navigator from '../../../../render/vue/modules/navigator'
+
+describe('navigator module', () => {
+  const callback = sinon.spy()
+  it('should push be worked', () => {
+      const { push } = navigator.default
+      const config = {
+        url: '/'
+      }
+      expect(push).to.be.a('function')
+      push(config, callback)
+      expect(callback.callCount).to.be.equal(1)
+  })
+  it('should push be worked', () => {
+      const { pop } = navigator.default
+      const config = {
+        url: '/'
+      }
+      expect(pop).to.be.a('function')
+      pop(config, callback)
+      expect(callback.callCount).to.be.equal(2)
+  })
+})
\ No newline at end of file