Title: Testing: inconsistencies between Location and SpyLocation · Issue #27059 · angular/angular · GitHub
Open Graph Title: Testing: inconsistencies between Location and SpyLocation · Issue #27059 · angular/angular
X Title: Testing: inconsistencies between Location and SpyLocation · Issue #27059 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/common/testing Is this a regression? No, I think it never worked. Description The normalize method in the Location class works correctly, when in the SpyLocation class...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/common/testing Is this a regression? No, I think it never worked. Description The normalize method in the Location class works ...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/common/testing Is this a regression? No, I think it never worked. Description The normalize method in the Location class works ...
Opengraph URL: https://github.com/angular/angular/issues/27059
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Testing: inconsistencies between Location and SpyLocation","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄 \r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\n\u003c!-- ✍️edit: --> The issue is caused by package @angular/common/testing\r\n\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️--> No, I think it never worked.\r\n\r\n\r\n### Description\r\n\r\n- The `normalize` method in the `Location` class works correctly, when in the `SpyLocation` class it always returns `null `(https://github.com/angular/angular/blob/7.0.3/packages/common/testing/src/location_mock.ts#L120)\r\n- The `subscribe` method in the `Location` class is fired only on `popstate` event (https://github.com/angular/angular/blob/7.0.3/packages/common/src/location/location.ts#L140), when in the `SpyLocation` class is fired on each navigation (https://github.com/angular/angular/blob/7.0.3/packages/common/testing/src/location_mock.ts#L115) \r\n\r\n## 🔥 Exception or Error\r\nThe different behavior breaks the tests.\r\n\r\n## 🌍 Your Environment\r\n**Angular Version:**\r\n```\r\nAngular CLI: 7.0.1\r\nNode: 8.11.1\r\nOS: win32 x64\r\nAngular: 7.0.0\r\n```\r\n\r\n**Anything else relevant?**\r\nThere are unresolved issues related to these inconsistencies: https://github.com/angular/angular/issues/10963 and https://stackoverflow.com/questions/47484775/location-class-from-angular-common-doesnt-work-in-unit-tests\r\n\r\nThanks!\r\n","author":{"url":"https://github.com/robisim74","@type":"Person","name":"robisim74"},"datePublished":"2018-11-12T14:08:52Z","url":"https://github.com/angular/angular/issues/27059"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:cf739ab9-4223-62b2-307e-0fa9e6dc8cc9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEC2:1AE20C:C6A5ED:FC9D1B:6B00FCAA |
| html-safe-nonce | 674d3162ee37fab78beabeb0a04deaa4afc680f573fec7b38fc7258af5e5c834 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUMyOjFBRTIwQzpDNkE1RUQ6RkM5RDFCOjZCMDBGQ0FBIiwidmlzaXRvcl9pZCI6IjQ3NjMwODk1ODc0MTExNTYxMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 41c152f8d150c536239844c014c654762a2069a62ae53614fb2d285ffa51cf2b |
| hovercard-subject-tag | issue:379792931 |
| 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/27059/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0fba13892ad479f0b79a38c5064857fa2e8e8707c640637e5a2bce4e60321400/angular/angular/issues/27059 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0fba13892ad479f0b79a38c5064857fa2e8e8707c640637e5a2bce4e60321400/angular/angular/issues/27059 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/common/testing Is this a regression? No, I think it never worked. Description The normalize method in the Location class works ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robisim74 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width