Title: Provide the ability to test directives that contain input signals without wrapper components · Issue #54164 · angular/angular · GitHub
Open Graph Title: Provide the ability to test directives that contain input signals without wrapper components · Issue #54164 · angular/angular
X Title: Provide the ability to test directives that contain input signals without wrapper components · Issue #54164 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Given the following simple directive with a signal input: @Directive({ selector: '[appSimple]', standalone: true, host: { '(click)': 'doSomething()...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Given the following simple directive with a signal input: @Directive({ selector: '[appSimple]', standalone:...
X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Given the following simple directive with a signal input: @Directive({ selector: '[appSimple]', sta...
Opengraph URL: https://github.com/angular/angular/issues/54164
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Provide the ability to test directives that contain input signals without wrapper components","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nGiven the following simple directive with a signal input:\r\n\r\n```typescript\r\n@Directive({\r\n selector: '[appSimple]',\r\n standalone: true,\r\n host: {\r\n '(click)': 'doSomething()',\r\n }\r\n})\r\nexport class SimpleDirective {\r\n data = input.required\u003cstring\u003e();\r\n\r\n doSomething() {\r\n console.log(this.data());\r\n }\r\n}\r\n```\r\n\r\nThere is no way for me to write a test because I can not create a \"DirectiveFixture\" where I can \"setInput\"\n\n### Proposed solution\n\nProvide a similar approach as `TestBed.compileComponents` but for directives.\n\n### Alternatives considered\n\nStick with requiring wrapper components to test, but add documentation when input signals become available as part of the public API. ","author":{"url":"https://github.com/jamcoupe","@type":"Person","name":"jamcoupe"},"datePublished":"2024-01-30T20:51:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/54164/angular/issues/54164"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b3477069-886c-5015-d1a6-78909bab060d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8482:1A9341:6BC03E:93EE4E:6A627B04 |
| html-safe-nonce | fa498a95fdeb3d0a0d556a6042d0b0333672ced6d6ec85a62a21cbccd1cdc14c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDgyOjFBOTM0MTo2QkMwM0U6OTNFRTRFOjZBNjI3QjA0IiwidmlzaXRvcl9pZCI6Ijg0MTIwMzAxNTkyNTY5NzYxMzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3078bc9754e927258ff438a17ea96f59e871001d39b3b63611114a4eac669427 |
| hovercard-subject-tag | issue:2108753251 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/54164/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc575a771295c38d0d83aca61efa5b644769263d7d214ed1f561651020537628/angular/angular/issues/54164 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc575a771295c38d0d83aca61efa5b644769263d7d214ed1f561651020537628/angular/angular/issues/54164 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? core Description Given the following simple directive with a signal input: @Directive({ selector: '[appSimple]', standalone:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jamcoupe |
| hostname | github.com |
| expected-hostname | github.com |
| None | 838e87bd0e4f5415707a930bc14e89e382dc2ea046e50ff575252eb2f2cb06a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f0081192f88523d2bf4cfdf22bb3e138affc4cd1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width