Title: [testing]: overridePipe forces to redefine the name of the pipe · Issue #24102 · angular/angular · GitHub
Open Graph Title: [testing]: overridePipe forces to redefine the name of the pipe · Issue #24102 · angular/angular
X Title: [testing]: overridePipe forces to redefine the name of the pipe · Issue #24102 · angular/angular
Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submi...
Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...
X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or reques...
Opengraph URL: https://github.com/angular/angular/issues/24102
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[testing]: overridePipe forces to redefine the name of the pipe","articleBody":"## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" --\u003e\r\n\u003cpre\u003e\u003ccode\u003e\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting --\u003e\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request =\u003e Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n## Current behavior\r\n\r\nCurrently when you want to use `overridePipe` in a test to set `pure` to false for example, you have to also specify the name in the metadata override:\r\n\r\n```typescript\r\nconst fixture = TestBed\r\n .overridePipe(DisplayNamePipe, { set: { name: 'displayName', pure: false } })\r\n .createComponent(MenuComponent);\r\n```\r\n\r\nHere the only thing we want to set is the `pure` metadata, but we have to set the `name` also because `MetadataOverride` is defined like this:\r\n\r\n```typescript\r\nexport declare type MetadataOverride\u003cT\u003e = {\r\n add?: T;\r\n remove?: T;\r\n set?: T;\r\n};\r\n```\r\n\r\nAnd the `Pipe` metadata is:\r\n\r\n```typescript\r\nexport interface Pipe {\r\n name: string;\r\n pure?: boolean;\r\n}\r\n```\r\n\r\nso the `name` is mandatory.\r\n\r\n## Expected behavior\r\n\r\nWe should not have to set/add/remove the `name` in overridePipe when we want to set/add/remove another property. this is the same with `overrideComponent`, `overrideDirective`, ... But in these all the fiels of the interfaces are (for now) optional.\r\n\r\nWe should be able to write: \r\n\r\n```typescript\r\nconst fixture = TestBed\r\n .overridePipe(DisplayNamePipe, { set: { pure: false } })\r\n .createComponent(MenuComponent);\r\n```\r\n\r\n## Environment\r\n\r\n\u003cpre\u003e\u003ccode\u003e\r\nAngular version: 6.0.3\r\n\r\nBrowser:\r\n- [x] Chrome (desktop) version XX\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: 8.11\r\n- Platform: Mac\r\n\r\n\u003c/code\u003e\u003c/pre\u003e\r\n","author":{"url":"https://github.com/cexbrayat","@type":"Person","name":"cexbrayat"},"datePublished":"2018-05-24T14:02:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/24102/angular/issues/24102"}
| 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:f7b757ba-7727-f9e0-0ee3-bfe3429fd6ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C8F4:15A461:344E69:468615:6A6163DD |
| html-safe-nonce | e2d0a25c457871fd1e755c7412ac1136e639859ced5b3036cc077cfebffe68ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEY0OjE1QTQ2MTozNDRFNjk6NDY4NjE1OjZBNjE2M0REIiwidmlzaXRvcl9pZCI6IjYyNzYwMDUzNDU0NDY3MTcwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b281786a88bf70b79a845e5834b04bc13cd4ee058c07fa6dab691c27d9579e8c |
| hovercard-subject-tag | issue:326136619 |
| 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/24102/issue_layout |
| twitter:image | https://opengraph.githubassets.com/40d800dc13f2f763ea8dcb40140ea8f909c845ff8208755656d20c8970f6b4a7/angular/angular/issues/24102 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/40d800dc13f2f763ea8dcb40140ea8f909c845ff8208755656d20c8970f6b4a7/angular/angular/issues/24102 |
| og:image:alt | I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cexbrayat |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| 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 | 5f67bc431418961e0814f1eb30a4231250e4726d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width