Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Testing shadcn/ui components with TWD

I’ve put together a small documentation site that shows how to test shadcn/ui components using TWD, built on top of Testing Library. If you already use Testing Library, this means you can keep the same queries and assertions while gaining …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I’ve put together a small documentation site that shows how to test shadcn/ui components using TWD, built on top of Testing Library.



If you already use Testing Library, this means you can keep the same queries and assertions while gaining the benefits of Testing While Developing: running tests directly inside your real application as you build UI.



This approach helps:




  • Validate real shadcn components in real screens

  • Turn manual UI checks into repeatable tests

  • Keep tests close to real user interactions

  • Reuse Testing Library knowledge and patterns



You can find the docs and examples here: https://brikev.github.io/twd-shadcn/



The goal is not to replace existing testing tools, but to make UI testing part of the everyday development workflow.









Example: testing a Collapsible component



Given a simple shadcn/ui Collapsible component:




import { Button } from "@/components/ui/button";
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/components/ui/collapsible";

export function CollapsibleDemo() {
return (
<Collapsible>
<CollapsibleTrigger asChild>
<Button variant="outline">Toggle content</Button>
</CollapsibleTrigger>
<CollapsibleContent>
<div className="mt-4 p-4 border rounded-md">
Here is some hidden content
</div>
</CollapsibleContent>
</Collapsible>
);
}






With TWD, the test focuses on real user behavior and uses familiar Testing Library-style queries:




import { twd, screenDom, userEvent } from 'twd-js';
import { describe, it, expect } from 'twd-js/runner';

describe('Collapsible Component', () => {
it('toggles content visibility on trigger click', async () => {
await twd.visit('/collapsible');

const toggleButton = await screenDom.findByRole('button', { name: 'Toggle content' });
twd.should(toggleButton, 'be.visible');

// Initially collapsed (content not in DOM)
let content = screenDom.queryByText('Here is some hidden content');
expect(content).eql(null);

// Open
await userEvent.click(toggleButton);
const opened = await screenDom.findByText('Here is some hidden content');
twd.should(opened, 'be.visible');

// Close
await userEvent.click(toggleButton);
const closed = screenDom.queryByText('Here is some hidden content');
expect(closed).eql(null);
});
});






The test runs inside the real application, validating the component exactly as a user would interact with it.

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Testing shadcn/ui components with TWD
id: 297d55ac-bf33-4431-873c-c1d53a2b0072
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-26
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-26"
        description = "YARA Signature for "
    strings:
        $str = "Testing shadcn/ui components w" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Testing shadcnui components with TWD")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Testing shadcnui components with TWD*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Testing shadcnui components with TWD"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Testing shadcn/ui components with TWD.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Testing shadcn/ui components with TWD

Thematisch verwandte Begriffe: Testing, shadcnui, components, with · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-88003 | InvoicePlane is a self-hosted open source application for managing invoi…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag