You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2025/02/25 15:52:31 UTC

(myfaces-tobago) branch main updated: test: there must be spaces between buttons

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/main by this push:
     new fe867cb7ce test: there must be spaces between buttons
fe867cb7ce is described below

commit fe867cb7ce591aa347592a972bc66f63c394b51d
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Feb 25 14:05:29 2025 +0100

    test: there must be spaces between buttons
---
 .../00-button-link/Button_and_Link.test.js         | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/040-command/00-button-link/Button_and_Link.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/040-command/00-button-link/Button_and_Link.test.js
new file mode 100644
index 0000000000..3c4c6a7682
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/040-command/00-button-link/Button_and_Link.test.js
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
+import {elementByIdFn, querySelectorFn} from "/script/tobago-test.js";
+
+it("Spaces between buttons", function (done) {
+  const b1Spacing = elementByIdFn("page:mainForm:b1")().getBoundingClientRect();
+  const b2Spacing = elementByIdFn("page:mainForm:b2")().getBoundingClientRect();
+  const b4Spacing = elementByIdFn("page:mainForm:b4")().getBoundingClientRect();
+  const b5Spacing = elementByIdFn("page:mainForm:b5")().getBoundingClientRect();
+
+  const test = new JasmineTestTool(done);
+  test.do(() => expect(b1Spacing.right < b2Spacing.left).toBeTrue());
+  test.do(() => expect(b2Spacing.right < b4Spacing.left).toBeTrue());
+  test.do(() => expect(b4Spacing.right < b5Spacing.left).toBeTrue());
+  test.start();
+});