mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 21:46:29 +00:00
* fix(a11y): Remove unnecessary alternate text * fix: Remove alternate text from test images
This commit is contained in:
parent
7d83c7cac1
commit
3382821641
2 changed files with 7 additions and 6 deletions
|
@ -20,7 +20,7 @@ test('format a simple contributor', () => {
|
||||||
const {options} = fixtures()
|
const {options} = fixtures()
|
||||||
|
|
||||||
const expected =
|
const expected =
|
||||||
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a>'
|
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt=""/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a>'
|
||||||
|
|
||||||
expect(formatContributor(options, contributor)).toBe(expected)
|
expect(formatContributor(options, contributor)).toBe(expected)
|
||||||
})
|
})
|
||||||
|
@ -30,7 +30,7 @@ test('format contributor with complex contribution types', () => {
|
||||||
const {options} = fixtures()
|
const {options} = fixtures()
|
||||||
|
|
||||||
const expected =
|
const expected =
|
||||||
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=kentcdodds" title="Documentation">📖</a> <a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a> <a href="#question-kentcdodds" title="Answering Questions">💬</a>'
|
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt=""/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=kentcdodds" title="Documentation">📖</a> <a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a> <a href="#question-kentcdodds" title="Answering Questions">💬</a>'
|
||||||
|
|
||||||
expect(formatContributor(options, contributor)).toBe(expected)
|
expect(formatContributor(options, contributor)).toBe(expected)
|
||||||
})
|
})
|
||||||
|
@ -53,7 +53,8 @@ test('default image size to 100', () => {
|
||||||
delete options.imageSize
|
delete options.imageSize
|
||||||
|
|
||||||
const expected =
|
const expected =
|
||||||
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a>'
|
'<a href="http://kentcdodds.com"><img src="https://avatars1.githubusercontent.com/u/1500684" width="100px;" alt=""/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/pulls?q=is%3Apr+reviewed-by%3Akentcdodds" title="Reviewed Pull Requests">👀</a>'
|
||||||
|
|
||||||
|
|
||||||
expect(formatContributor(options, contributor)).toBe(expected)
|
expect(formatContributor(options, contributor)).toBe(expected)
|
||||||
})
|
})
|
||||||
|
@ -63,7 +64,7 @@ test('format contributor with pipes in their name', () => {
|
||||||
const {options} = fixtures()
|
const {options} = fixtures()
|
||||||
|
|
||||||
const expected =
|
const expected =
|
||||||
'<a href="http://github.com/chrisinajar"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt="Who | Needs | Pipes?"/><br /><sub><b>Who | Needs | Pipes?</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=pipey" title="Documentation">📖</a>'
|
'<a href="http://github.com/chrisinajar"><img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt=""/><br /><sub><b>Who | Needs | Pipes?</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=pipey" title="Documentation">📖</a>'
|
||||||
|
|
||||||
expect(formatContributor(options, contributor)).toBe(expected)
|
expect(formatContributor(options, contributor)).toBe(expected)
|
||||||
})
|
})
|
||||||
|
@ -73,7 +74,7 @@ test('format contributor with no github account', () => {
|
||||||
const {options} = fixtures()
|
const {options} = fixtures()
|
||||||
|
|
||||||
const expected =
|
const expected =
|
||||||
'<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt="No Github Account"/><br /><sub><b>No Github Account</b></sub><br /><a href="#translation" title="Translation">🌍</a>'
|
'<img src="https://avatars1.githubusercontent.com/u/1500684" width="150px;" alt=""/><br /><sub><b>No Github Account</b></sub><br /><a href="#translation" title="Translation">🌍</a>'
|
||||||
|
|
||||||
expect(formatContributor(options, contributor)).toBe(expected)
|
expect(formatContributor(options, contributor)).toBe(expected)
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@ const _ = require('lodash/fp')
|
||||||
const formatContributionType = require('./format-contribution-type')
|
const formatContributionType = require('./format-contribution-type')
|
||||||
|
|
||||||
const avatarTemplate = _.template(
|
const avatarTemplate = _.template(
|
||||||
'<img src="<%= contributor.avatar_url %>" width="<%= options.imageSize %>px;" alt="<%= name %>"/>',
|
'<img src="<%= contributor.avatar_url %>" width="<%= options.imageSize %>px;" alt=""/>',
|
||||||
)
|
)
|
||||||
const avatarBlockTemplate = _.template(
|
const avatarBlockTemplate = _.template(
|
||||||
'<a href="<%= contributor.profile %>"><%= avatar %><br /><sub><b><%= name %></b></sub></a>',
|
'<a href="<%= contributor.profile %>"><%= avatar %><br /><sub><b><%= name %></b></sub></a>',
|
||||||
|
|
Loading…
Reference in a new issue