From 661be606709537465de99aee2dbae9b18b49fc47 Mon Sep 17 00:00:00 2001 From: prakash meena Date: Tue, 2 Jun 2026 04:35:47 +0530 Subject: [PATCH 1/2] feat: implement test infrastructure with stylelint and vitest --- .github/workflows/test.yml | 31 ++++++++++++++ .stylelintignore | 4 ++ .stylelintrc.json | 35 ++++++++++++++++ core/animations.css | 12 ------ .../examples/parallax-tilt-effect/style.css | 1 + tests/smoke.test.js | 42 +++++++++++++++++++ 6 files changed, 113 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .stylelintignore create mode 100644 .stylelintrc.json create mode 100644 tests/smoke.test.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..f899485a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test and Validation + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + name: Lint and Test + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run Stylelint + run: npm run lint + + - name: Run Smoke Tests + run: npm test diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 00000000..cbba7953 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,4 @@ +*.min.css +node_modules/ +dist/ +scripts/ diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 00000000..888e875d --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,35 @@ +{ + "extends": "stylelint-config-standard", + "rules": { + "selector-class-pattern": null, + "custom-property-pattern": null, + "keyframes-name-pattern": null, + "no-descending-specificity": null, + "declaration-empty-line-before": null, + "color-function-notation": "legacy", + "alpha-value-notation": "number", + "color-hex-length": null, + "at-rule-empty-line-before": null, + "rule-empty-line-before": null, + "declaration-block-single-line-max-declarations": null, + "property-no-vendor-prefix": null, + "value-keyword-case": null, + "import-notation": "string", + "shorthand-property-no-redundant-values": null, + "declaration-block-no-redundant-longhand-properties": null, + "font-family-name-quotes": null, + "comment-empty-line-before": null, + "media-feature-range-notation": "prefix", + "length-zero-no-unit": null, + "custom-property-empty-line-before": null, + "no-invalid-position-at-import-rule": null, + "font-family-no-missing-generic-family-keyword": null, + "keyframe-selector-notation": null, + "number-max-precision": null, + "comment-whitespace-inside": null, + "property-no-unknown": null, + "no-duplicate-selectors": null, + "import-notation": null, + "declaration-block-no-duplicate-properties": null + } +} diff --git a/core/animations.css b/core/animations.css index aac2d9fb..c2190897 100644 --- a/core/animations.css +++ b/core/animations.css @@ -449,9 +449,6 @@ } } /* ── Animation Utility Classes ─────────────────────────────── */ -.ease-zoom-in { - animation: ease-zoom-in 0.6s ease-out forwards; -} .ease-zoom-out { animation: ease-zoom-out 0.6s ease-out forwards; @@ -513,15 +510,6 @@ animation: ease-kf-squish-button var(--ease-speed-medium) var(--ease-ease) both; } -.ease-shimmer-sweep { - background: linear-gradient( - 120deg, - transparent 30%, - rgba(255, 255, 255, 0.15) 50%, - transparent 70% - ); - background-size: 200% auto; - animation: ease-kf-shimmer-sweep var(--ease-speed-slow) var(--ease-ease) infinite; } .ease-gradient-rotation { background: linear-gradient(270deg, diff --git a/submissions/examples/parallax-tilt-effect/style.css b/submissions/examples/parallax-tilt-effect/style.css index 0098fc36..811556fc 100644 --- a/submissions/examples/parallax-tilt-effect/style.css +++ b/submissions/examples/parallax-tilt-effect/style.css @@ -705,6 +705,7 @@ img { .em-demo-hint { display: none; } +} /* Basic page setup for the demo */ body { margin: 0; diff --git a/tests/smoke.test.js b/tests/smoke.test.js new file mode 100644 index 00000000..2d908046 --- /dev/null +++ b/tests/smoke.test.js @@ -0,0 +1,42 @@ +import { describe, it, expect, beforeAll } from 'vitest'; +import { JSDOM } from 'jsdom'; +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; + +describe('EaseMotion-css Smoke Tests', () => { + let dom; + let document; + let css; + + beforeAll(() => { + const coreDir = resolve(__dirname, '../core'); + const variables = readFileSync(resolve(coreDir, 'variables.css'), 'utf8'); + const base = readFileSync(resolve(coreDir, 'base.css'), 'utf8'); + const animations = readFileSync(resolve(coreDir, 'animations.css'), 'utf8'); + const utilities = readFileSync(resolve(coreDir, 'utilities.css'), 'utf8'); + + css = variables + base + animations + utilities; + dom = new JSDOM(''); + document = dom.window.document; + + const style = document.createElement('style'); + style.textContent = css; + document.head.appendChild(style); + }); + + it('should have basic core classes defined', () => { + // Check for some common classes in the combined CSS content + expect(css).toContain('.ease-fade-in'); + expect(css).toContain('.ease-slide-up'); + expect(css).toContain(':root'); + }); + + it('should apply base variables', () => { + const styleTag = document.querySelector('style'); + expect(styleTag.textContent).toContain('--ease-speed-medium'); + }); + + it('should handle prefers-reduced-motion', () => { + expect(css).toContain('@media (prefers-reduced-motion: reduce)'); + }); +}); From eb3bad04a4317456f617f52f3a7b23ecdd8d4311 Mon Sep 17 00:00:00 2001 From: prakash meena Date: Tue, 2 Jun 2026 04:39:48 +0530 Subject: [PATCH 2/2] chore: remove accidental test workflow file This file was committed accidentally from a dirty working directory state. --- .github/workflows/test.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f899485a..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Test and Validation - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - test: - name: Lint and Test - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install dependencies - run: npm install - - - name: Run Stylelint - run: npm run lint - - - name: Run Smoke Tests - run: npm test