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
4 changes: 4 additions & 0 deletions .github/workflows/web_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
working-directory: ./renderers/web_core
run: npm run build

- name: Run web_core tests
working-directory: ./renderers/web_core
run: npm test

- name: Install Lit renderer dependencies
working-directory: ./renderers/lit
run: npm i
Expand Down
7 changes: 7 additions & 0 deletions renderers/web_core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@
"prepack": "npm run build",
"build": "wireit",
"build:tsc": "wireit",
"copy-spec": "wireit",
"test": "wireit"
},
"wireit": {
"test": {
"command": "find dist -name '*.test.js' | xargs node --test --enable-source-maps --test-reporter spec",
"dependencies": [
"build"
]
},
"copy-spec": {
"command": "node scripts/copy-spec.js",
"files": [
Expand Down
18 changes: 18 additions & 0 deletions renderers/web_core/src/v0_8/styles/border.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import test from 'node:test';
import assert from 'node:assert';
import { border } from './border.js';

test('Border Styles', async (t) => {
await t.test('border-radius classes should not apply overflow: hidden to avoid text clipping', () => {
// The issue reported clipping of text when using rounded corners because
// .border-br-* generated classes also blindly applied overflow: hidden.

// Check if the generated CSS contains overflow: hidden for border-br classes
const match = border.match(/\.border-br-\w+ \{[^}]*overflow:\s*hidden/);
assert.strictEqual(match, null, 'Found overflow: hidden applied within a border-br-* class');

// Check that we DO have the expected border-radius applied
const hasBorderRadius = border.match(/\.border-br-1 \{ border-radius: [^;]+; \}/);
assert.notStrictEqual(hasBorderRadius, null, 'Missing border-radius in border-br-* class');
});
});
2 changes: 1 addition & 1 deletion renderers/web_core/src/v0_8/styles/border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const border = `
.border-brw-${idx} { border-right-width: ${idx}px; }

.border-ow-${idx} { outline-width: ${idx}px; }
.border-br-${idx} { border-radius: ${idx * grid}px; overflow: hidden;}`;
.border-br-${idx} { border-radius: ${idx * grid}px; }`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Per the repository style guide, code changes should include tests. To prevent this text clipping issue from recurring, please consider adding a test case (e.g., a visual regression test) that verifies this fix.

References
  1. The repository style guide states: 'If there are code changes, code should have tests.' (link)

})
.join("\n")}

Expand Down
Loading