-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for the platformstyle.js (#4168)
* Create platformstyle.test.js * Update jest.config.js * Update musicutils.test.js resolving conflicts with the platformstyle.test.js
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
describe('Platform Style Tests', () => { | ||
beforeEach(() => { | ||
const meta = document.createElement('meta'); | ||
meta.name = 'theme-color'; | ||
document.head.appendChild(meta); | ||
}); | ||
|
||
afterEach(() => { | ||
document.head.innerHTML = ''; | ||
}); | ||
|
||
test('should set the meta theme-color content based on platformColor', () => { | ||
const platformColor = { header: '#ff0000' }; | ||
document.querySelector("meta[name=theme-color]").content = platformColor.header; | ||
|
||
const meta = document.querySelector("meta[name=theme-color]"); | ||
expect(meta.content).toBe('#ff0000'); | ||
}); | ||
}); |