Add liveRegion to required tests

flag=none

test plan:
  - Specs pass

qa risk: low

Change-Id: I9144193278beb7c7c4bf599609fc4df9b193fd54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274368
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
This commit is contained in:
Omar Gerardo Soto-Fortuño 2021-09-24 09:49:50 -04:00 committed by Omar Soto-Fortuño
parent 9919baab1b
commit e33afd939c
4 changed files with 61 additions and 22 deletions

View File

@ -124,7 +124,6 @@ const ignoredErrors = [
/The prop `jwt` is marked as required in `CanvasContentTray`/, /The prop `jwt` is marked as required in `CanvasContentTray`/,
/The prop `label` is marked as required in `(CanvasInstUIModal|FormField|FormFieldLayout|Modal)`/, /The prop `label` is marked as required in `(CanvasInstUIModal|FormField|FormFieldLayout|Modal)`/,
/The prop `listDeveloperKeyScopesSet` is marked as required in `(Scopes|ScopesList)`/, /The prop `listDeveloperKeyScopesSet` is marked as required in `(Scopes|ScopesList)`/,
/The prop `liveRegion` is marked as required in `(SecurityPanel|Whitelist)`/,
/The prop `loading` is marked as required in `(HomeroomAnnouncementsLayout|LoadingWrapper)`/, /The prop `loading` is marked as required in `(HomeroomAnnouncementsLayout|LoadingWrapper)`/,
/The prop `ltiKeysSetLtiKey` is marked as required in `DeveloperKeyActionButtons`/, /The prop `ltiKeysSetLtiKey` is marked as required in `DeveloperKeyActionButtons`/,
/The prop `name` is marked as required in `Avatar`/, /The prop `name` is marked as required in `Avatar`/,

View File

@ -43,7 +43,8 @@ describe('start', () => {
start(fixtures, { start(fixtures, {
context: 'account', context: 'account',
contextId: '1', contextId: '1',
api: fakeAxios api: fakeAxios,
liveRegion: []
}) })
}).not.toThrow() }).not.toThrow()
}) })

View File

@ -30,7 +30,7 @@ describe('ConnectedSecurityPanel', () => {
it('updates CSP enabled status when the checkbox is clicked', () => { it('updates CSP enabled status when the checkbox is clicked', () => {
const {getByLabelText} = renderWithRedux( const {getByLabelText} = renderWithRedux(
<ConnectedSecurityPanel context="account" contextId="1" maxDomains={50} /> <ConnectedSecurityPanel context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const checkbox = getByLabelText('Enable Content Security Policy') const checkbox = getByLabelText('Enable Content Security Policy')
@ -41,7 +41,13 @@ describe('ConnectedSecurityPanel', () => {
describe('isSubAccount prop', () => { describe('isSubAccount prop', () => {
it('updates CSP inherited status when the inherit checkbox is clicked', () => { it('updates CSP inherited status when the inherit checkbox is clicked', () => {
const {getByLabelText} = renderWithRedux( const {getByLabelText} = renderWithRedux(
<ConnectedSecurityPanel context="account" contextId="1" maxDomains={50} isSubAccount /> <ConnectedSecurityPanel
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
isSubAccount
/>
) )
const checkbox = getByLabelText('Inherit Content Security Policy') const checkbox = getByLabelText('Inherit Content Security Policy')
@ -51,7 +57,13 @@ describe('ConnectedSecurityPanel', () => {
it('disables the enable checkbox when the inherit option is set to true', () => { it('disables the enable checkbox when the inherit option is set to true', () => {
const {getByLabelText} = renderWithRedux( const {getByLabelText} = renderWithRedux(
<ConnectedSecurityPanel context="account" contextId="1" maxDomains={50} isSubAccount /> <ConnectedSecurityPanel
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
isSubAccount
/>
) )
const checkbox = getByLabelText('Inherit Content Security Policy') const checkbox = getByLabelText('Inherit Content Security Policy')

View File

@ -30,7 +30,7 @@ describe('ConnectedWhitelist', () => {
it('renders items on the allowed domain list after they are added', () => { it('renders items on the allowed domain list after they are added', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const domainInput = getByLabelText('Domain Name') const domainInput = getByLabelText('Domain Name')
@ -45,7 +45,7 @@ describe('ConnectedWhitelist', () => {
it('handles adding wildcard entries to the allowed domain list', () => { it('handles adding wildcard entries to the allowed domain list', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const domainInput = getByLabelText('Domain Name') const domainInput = getByLabelText('Domain Name')
@ -60,7 +60,7 @@ describe('ConnectedWhitelist', () => {
it('renders the empty state when there are no domains', () => { it('renders the empty state when there are no domains', () => {
const {getByText} = renderWithRedux( const {getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const emptyState = getByText('No allowed domains') const emptyState = getByText('No allowed domains')
expect(emptyState).toBeInTheDocument() expect(emptyState).toBeInTheDocument()
@ -68,7 +68,7 @@ describe('ConnectedWhitelist', () => {
it('renders the tools domain list when present', () => { it('renders the tools domain list when present', () => {
const {getByText} = renderWithRedux( const {getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -93,7 +93,7 @@ describe('ConnectedWhitelist', () => {
it('shows an error message when an invalid domain is entered', () => { it('shows an error message when an invalid domain is entered', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const domainInput = getByLabelText('Domain Name') const domainInput = getByLabelText('Domain Name')
@ -108,7 +108,7 @@ describe('ConnectedWhitelist', () => {
it('shows the correct count for the domain list', () => { it('shows the correct count for the domain list', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const domainInput = getByLabelText('Domain Name') const domainInput = getByLabelText('Domain Name')
@ -123,7 +123,7 @@ describe('ConnectedWhitelist', () => {
it('clears the input box after a successful submisssion', () => { it('clears the input box after a successful submisssion', () => {
const {getByLabelText} = renderWithRedux( const {getByLabelText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} /> <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />
) )
const domainInput = getByLabelText('Domain Name') const domainInput = getByLabelText('Domain Name')
@ -137,7 +137,7 @@ describe('ConnectedWhitelist', () => {
it('removes items when clicking the delete icon', () => { it('removes items when clicking the delete icon', () => {
const {getByText, queryByText} = renderWithRedux( const {getByText, queryByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -156,7 +156,7 @@ describe('ConnectedWhitelist', () => {
it('sets focus to the previous domain delete icon when deleting', () => { it('sets focus to the previous domain delete icon when deleting', () => {
const {getByText, getByTestId} = renderWithRedux( const {getByText, getByTestId} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -175,7 +175,7 @@ describe('ConnectedWhitelist', () => {
it('sets focus to the the add domain button when removing the first positioned domain from the allowed domain list', () => { it('sets focus to the the add domain button when removing the first positioned domain from the allowed domain list', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -193,7 +193,7 @@ describe('ConnectedWhitelist', () => {
it('sets focus to the add domain button when removing the last remaining domain from the allowed domain list', () => { it('sets focus to the add domain button when removing the last remaining domain from the allowed domain list', () => {
const {getByLabelText, getByText} = renderWithRedux( const {getByLabelText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -216,7 +216,7 @@ describe('ConnectedWhitelist', () => {
exampleDomains.push(`domain-${i}.com`) exampleDomains.push(`domain-${i}.com`)
} }
const {getByLabelText} = renderWithRedux( const {getByLabelText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -236,7 +236,7 @@ describe('ConnectedWhitelist', () => {
exampleDomains.push(`domain-${i}.com`) exampleDomains.push(`domain-${i}.com`)
} }
const {getByText} = renderWithRedux( const {getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} />, <ConnectedWhitelist context="account" contextId="1" maxDomains={50} liveRegion={[]} />,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -257,7 +257,13 @@ describe('ConnectedWhitelist', () => {
exampleDomains.push(`domain-${i}.com`) exampleDomains.push(`domain-${i}.com`)
} }
const {queryByText} = renderWithRedux( const {queryByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} inherited />, <ConnectedWhitelist
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
inherited
/>,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -278,6 +284,7 @@ describe('ConnectedWhitelist', () => {
context="account" context="account"
contextId="1" contextId="1"
maxDomains={50} maxDomains={50}
liveRegion={[]}
inherited inherited
isSubAccount isSubAccount
/>, />,
@ -299,7 +306,13 @@ describe('ConnectedWhitelist', () => {
it('shows the allowed domain list from the inherited account', () => { it('shows the allowed domain list from the inherited account', () => {
const {getByText, queryByText} = renderWithRedux( const {getByText, queryByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} inherited />, <ConnectedWhitelist
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
inherited
/>,
{ {
initialState: { initialState: {
whitelistedDomains: { whitelistedDomains: {
@ -319,7 +332,13 @@ describe('ConnectedWhitelist', () => {
it('does not show the count for the allowed domain list', () => { it('does not show the count for the allowed domain list', () => {
const {queryByText, getByText} = renderWithRedux( const {queryByText, getByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} inherited /> <ConnectedWhitelist
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
inherited
/>
) )
const wrongString = queryByText('Domains (0/50)') const wrongString = queryByText('Domains (0/50)')
@ -335,6 +354,7 @@ describe('ConnectedWhitelist', () => {
context="account" context="account"
contextId="1" contextId="1"
maxDomains={50} maxDomains={50}
liveRegion={[]}
inherited inherited
isSubAccount isSubAccount
/>, />,
@ -358,6 +378,7 @@ describe('ConnectedWhitelist', () => {
context="account" context="account"
contextId="1" contextId="1"
maxDomains={50} maxDomains={50}
liveRegion={[]}
inherited inherited
isSubAccount isSubAccount
/>, />,
@ -379,7 +400,13 @@ describe('ConnectedWhitelist', () => {
describe('isSubAccount', () => { describe('isSubAccount', () => {
it('does not show the option to view a violation log', () => { it('does not show the option to view a violation log', () => {
const {queryByText} = renderWithRedux( const {queryByText} = renderWithRedux(
<ConnectedWhitelist context="account" contextId="1" maxDomains={50} isSubAccount /> <ConnectedWhitelist
context="account"
contextId="1"
maxDomains={50}
liveRegion={[]}
isSubAccount
/>
) )
const violationLogBtn = queryByText('View Violation Log') const violationLogBtn = queryByText('View Violation Log')
expect(violationLogBtn).toBeNull() expect(violationLogBtn).toBeNull()