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/09/01 10:32:42 UTC

(myfaces-tobago) branch main updated: test(sheet): background-color

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 f4a64daf3a test(sheet): background-color
f4a64daf3a is described below

commit f4a64daf3a043b2adfca04e05752f1bbc9f60cc4
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Mon Sep 1 12:18:42 2025 +0200

    test(sheet): background-color
    
    * add tables variables
---
 .../src/test/typescript/base/bootstrap-variables.ts  | 20 ++++++++++++++++++++
 .../src/test/typescript/sheet.test.ts                | 10 +++++-----
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/test/typescript/base/bootstrap-variables.ts b/tobago-example/tobago-example-demo/src/test/typescript/base/bootstrap-variables.ts
index 75e15641d5..b5c9e54408 100644
--- a/tobago-example/tobago-example-demo/src/test/typescript/base/bootstrap-variables.ts
+++ b/tobago-example/tobago-example-demo/src/test/typescript/base/bootstrap-variables.ts
@@ -174,3 +174,23 @@ export class Nav {
   static readonly tabsLinkActiveBg = Root.bodyBg;
   static readonly tabsLinkActiveBorderColor = Root.borderColor + " " + Root.borderColor + " " + Root.bodyBg;
 }
+
+/**
+ * CSS variables generated by https://github.com/twbs/bootstrap/blob/v5.3.8/scss/_tables.scss.
+ */
+export class Table {
+  static readonly colorType = "initial";
+  static readonly bgType = "initial";
+  static readonly colorState = "initial";
+  static readonly bgState = "initial";
+  static readonly color = "var(--bs-emphasis-color)";
+  static readonly bg = Root.bodyBg;
+  static readonly borderColor = "var(--bs-border-color)";
+  static readonly accentBg = "transparent";
+  static readonly stripedColor = "var(--bs-emphasis-color)";
+  static readonly stripedBg = "rgba(var(--bs-emphasis-color-rgb), 0.05)";
+  static readonly activeColor = "var(--bs-emphasis-color)";
+  static readonly activeBg = "rgba(var(--bs-emphasis-color-rgb), 0.1)";
+  static readonly hoverColor = "var(--bs-emphasis-color)";
+  static readonly hoverBg = "rgba(var(--bs-emphasis-color-rgb), 0.075)";
+}
diff --git a/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts b/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
index 43907ede57..bac2db36a4 100644
--- a/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
+++ b/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
@@ -18,7 +18,7 @@
  */
 
 import {expect, test} from "@playwright/test";
-import {Color} from "./base/browser-styles";
+import {Table} from "./base/bootstrap-variables";
 
 test.describe("900-test/3000-sheet/70-tree/Sheet_Tree.xhtml", () => {
 
@@ -86,8 +86,8 @@ test.describe("900-test/3000-sheet/70-tree/Sheet_Tree.xhtml", () => {
     const node9Toggle = sheet.locator("tobago-tree-node[index='9'] .tobago-toggle");
     await node9Toggle.click();
 
-    const row9cell = sheet.locator("tr[row-index='9'] td");
-    await expect(row9cell).toHaveCSS("background-color", Color.transparent);
+    const row9cell = sheet.locator("tr[row-index='9'] td:first-child");
+    await expect(row9cell).toHaveCSS("background-color", Table.bg);
     await expect(hiddenSelected).toHaveValue("[]");
 
     await expect(node8Out).toBeVisible();
@@ -106,8 +106,8 @@ test.describe("900-test/3000-sheet/70-tree/Sheet_Tree.xhtml", () => {
     const node8Toggle = sheet.locator("tobago-tree-node[index='8'] .tobago-toggle");
     await node8Toggle.click();
 
-    const row8cell = sheet.locator("tr[row-index='8'] td");
-    await expect(row8cell).toHaveCSS("background-color", Color.transparent);
+    const row8cell = sheet.locator("tr[row-index='8'] td:first-child");
+    await expect(row8cell).toHaveCSS("background-color", Table.bg);
     await expect(hiddenSelected).toHaveValue("[]");
 
     await expect(node8Out).toBeVisible();