Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
deundrewilliams committed Jan 13, 2022
1 parent f431f81 commit 110d67b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ describe('Question', () => {
const tree = component.toJSON()

expect(tree).toMatchSnapshot()

})

test('Screen reader text matches when error sending answer', () => {
Expand All @@ -238,5 +237,4 @@ describe('Question', () => {

expect(tree).toMatchSnapshot()
})

})
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,31 @@ const responseStatusCache = {}

const getResponseStatusUpdate = (questionIndex, responseSendState) => {
if (questionIndex in responseStatusCache) {

if (responseStatusCache[questionIndex] !== responseSendState && responseSendState !== null) {

responseStatusCache[questionIndex] = responseSendState;
responseStatusCache[questionIndex] = responseSendState

switch (responseSendState) {
case QuestionResponseSendStates.RECORDED:
return `Answer saved for question ${questionIndex+1}`
return `Answer saved for question ${questionIndex + 1}`
case QuestionResponseSendStates.ERROR:
return `Error sending response for question ${questionIndex+1}`
return `Error sending response for question ${questionIndex + 1}`
default:
return ""
return ''
}
}
} else {
responseStatusCache[questionIndex] = responseSendState;
responseStatusCache[questionIndex] = responseSendState
}

}

const QuestionResponseStatus = ({ responseSendState, timeout, questionIndex }) => {

const screenReaderText = getResponseStatusUpdate(questionIndex, responseSendState)

return (
<div className="response-status-container">
<div aria-live="polite" className="sr-response-status">{screenReaderText}</div>
<div aria-live="polite" className="sr-response-status">
{screenReaderText}
</div>
<CSSTransition
in={responseSendState === QuestionResponseSendStates.NOT_SENT}
classNames="response-status"
Expand Down
12 changes: 6 additions & 6 deletions packages/obonode/obojobo-chunks-question/viewer-component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@
}

.sr-response-status {
position:absolute;
left:-10000px;
top:auto;
width:1px;
height:1px;
overflow:hidden;
position: absolute;
left: -10000px; /* stylelint-disable-line unit-disallowed-list */
top: auto;
width: 1px; /* stylelint-disable-line unit-disallowed-list */
height: 1px; /* stylelint-disable-line unit-disallowed-list */
overflow: hidden;
}

.submit .obojobo-draft--components--button:first-child {
Expand Down

0 comments on commit 110d67b

Please sign in to comment.