Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Simran-B committed Dec 9, 2020
1 parent d64a444 commit 4dc1ce1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion javascripts/display-platform-specific-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function detectPlatforms (el) {
}

function getDefaultPlatform () {
const el = document.querySelector("[data-default-platform]")
const el = document.querySelector('[data-default-platform]')
if (el) return el.dataset.defaultPlatform
}

Expand Down
2 changes: 1 addition & 1 deletion lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const schema = {
// Platform-specific content preference
defaultPlatform: {
type: 'string',
enum: [ 'mac', 'windows', 'linux' ] // TODO: add 'all'?
enum: ['mac', 'windows', 'linux'] // TODO: add 'all'?
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/browser/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('platform specific content', () => {
const userAgents = [
{ name: 'Mac', id: 'mac', ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9' },
{ name: 'Windows', id: 'windows', ua: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36' },
{ name: 'Linux', id: 'linux', ua: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1' },
{ name: 'Linux', id: 'linux', ua: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1' }
]
const userAgentLinux = userAgents[2]

Expand All @@ -193,7 +193,7 @@ describe('platform specific content', () => {
await page.setUserAgent(agent.ua)
await page.goto('http://localhost:4001/en/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners')
const selectedPlatformElement = await page.waitForSelector('a.platform-switcher.selected')
const selectedPlatform = await page.evaluate( el => el.textContent, selectedPlatformElement)
const selectedPlatform = await page.evaluate(el => el.textContent, selectedPlatformElement)
expect(selectedPlatform).toBe(agent.name)
}
})
Expand All @@ -204,7 +204,7 @@ describe('platform specific content', () => {
await page.goto('http://localhost:4001/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service')
const defaultPlatform = await page.$eval('[data-default-platform]', el => el.dataset.defaultPlatform)
const selectedPlatformElement = await page.waitForSelector('a.platform-switcher.selected')
const selectedPlatform = await page.evaluate( el => el.textContent, selectedPlatformElement)
const selectedPlatform = await page.evaluate(el => el.textContent, selectedPlatformElement)
expect(defaultPlatform).toBe(userAgentLinux.id)
expect(selectedPlatform).toBe(userAgentLinux.name)
}
Expand Down

0 comments on commit 4dc1ce1

Please sign in to comment.