Skip to content

Commit

Permalink
fix: Dummy app hitting recently added assertion (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
raido authored Oct 7, 2020
1 parent 15a380f commit cba2987
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/dummy/app/initializers/remove-default-title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* This is here just for dummy app.
*
* Without it we would hit assertion from service:page-title-list
* because of our app/index.html has 2 <title> elements due to Fastboot.
*
* But having 2 <title> elements is intentional so we can acceptance test both
* browser and Fastboot scenarios together.
*/
export function initialize(/* application */) {
if (typeof FastBoot === 'undefined') {
let titleElements = document.head.getElementsByTagName('title');
let defaultTitle = titleElements.item(0);
if (defaultTitle && titleElements.length > 1) {
defaultTitle.parentElement.removeChild(defaultTitle);
}
}
}

export default {
initialize
};

0 comments on commit cba2987

Please sign in to comment.