3} />
-
-// this should rename it to the import alias of Link
-btn =
-btn =
-
-// the spread operator here should trigger a warning
-btn =
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/list.input.js b/packages/ui-codemods/__testfixtures__/updateV7Props/list.input.js
deleted file mode 100644
index 70473664c9..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/list.input.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* eslint-disable */
-import { List } from '@instructure/ui-list'
-
-const aVar = {}
-const a = (
-
-
-
-
- test
- {...aVar}
-
- // delimiter prop should trigger a warning
-
-
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/list.output.js b/packages/ui-codemods/__testfixtures__/updateV7Props/list.output.js
deleted file mode 100644
index fbeed68dc0..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/list.output.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* eslint-disable */
-import { List } from '@instructure/ui-list'
-
-import { InlineList } from '@instructure/ui'
-
-const aVar = {}
-const a = (
-
-
-
-
- test
- {...aVar}
-
- // delimiter prop should trigger a warning
-
-
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/pill.input.js b/packages/ui-codemods/__testfixtures__/updateV7Props/pill.input.js
deleted file mode 100644
index 70fe0df40d..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/pill.input.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* eslint-disable */
-import { Pill } from '@instructure/ui-pill'
-
-const aVar = () => 'hello'
-const a = (
-
-
-
- aaa
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/pill.output.js b/packages/ui-codemods/__testfixtures__/updateV7Props/pill.output.js
deleted file mode 100644
index 58cadf6f1c..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/pill.output.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* eslint-disable */
-import { Pill } from '@instructure/ui-pill'
-
-const aVar = () => 'hello'
-const a = (
-
- abc
- {aVar()}
- aaabcd
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/popover.input.js b/packages/ui-codemods/__testfixtures__/updateV7Props/popover.input.js
deleted file mode 100644
index 6aaa572d72..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/popover.input.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* eslint-disable */
-import { Popover } from '@instructure/ui-popover'
-
-const aVar = () => 'hello'
-const a = (
-
- // trigger
-
- abc
-
-
-
-
- {aVar()}
-
-
- // content
- abc
-
- {aVar()}
-
- // this just triggers a warning
- ppp
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/popover.output.js b/packages/ui-codemods/__testfixtures__/updateV7Props/popover.output.js
deleted file mode 100644
index ce593540fa..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/popover.output.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-import { Popover } from '@instructure/ui-popover'
-
-const aVar = () => 'hello'
-const a = (
-
- // trigger
-
- }>
-
- // content
- abc
-
-
-
- {aVar()}
-
-
-
-
- // this just triggers a warning
- ppp
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.input.js b/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.input.js
deleted file mode 100644
index 455d508839..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.input.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-
-const aVar = () => 'hello'
-const a = (
-
-
-
-
- // triggers manual upgrade warning
-
- // triggers manual upgrade warning
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.output.js b/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.output.js
deleted file mode 100644
index c1b06d61d1..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/tabs.output.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-
-const aVar = () => 'hello'
-const a = (
-
-
-
-
- // triggers manual upgrade warning
-
- // triggers manual upgrade warning
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.input.js b/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.input.js
deleted file mode 100644
index a040142d8e..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.input.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// these just result in warnings
-import { DeprecatedButton } from '@instructure/ui-buttons'
-import { Media } from '@instructure/ui-byline'
-import { MetricsList } from '@instructure/ui-metric'
-import { Position } from '@instructure/ui-position'
-import { Progress } from '@instructure/ui-progress'
-// add here something so there is test output
-import { Heading } from '@instructure/ui-heading'
-
-const a = (
-
-
-
-
-
-
-
-
-
- abc
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.output.js b/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.output.js
deleted file mode 100644
index de861031bf..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV7Props/v7ComponentDeprecations.output.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* eslint-disable */
-// these just result in warnings
-import { DeprecatedButton } from '@instructure/ui-buttons'
-import { Media } from '@instructure/ui-byline'
-import { MetricsList } from '@instructure/ui-metric'
-import { Position } from '@instructure/ui-position'
-import { Progress } from '@instructure/ui-progress'
-// add here something so there is test output
-import { Heading } from '@instructure/ui-heading'
-
-const a = (
-
-
-
-
-
-
-
-
-
- abc
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.input.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.input.js
deleted file mode 100644
index 316b1b16bf..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.input.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-
-const fun = () => "asdf"
-let a = (
-
-
-
- hello
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.output.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.output.js
deleted file mode 100644
index de1f524295..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/applyTheme.output.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-
-import { InstUISettingsProvider } from '@instructure/emotion'
-
-const fun = () => 'asdf'
-let a = (
-
-
-
- hello
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.input.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.input.js
deleted file mode 100644
index e28cd71c35..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.input.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-
-const aVar = () => 'hello'
-const a = (
-
-
-
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.output.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.output.js
deleted file mode 100644
index 0a5d890d5c..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeProp.output.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-
-const aVar = () => 'hello'
-const a = (
-
-
-
-
-
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.input.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.input.js
deleted file mode 100644
index ba108ee17b..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.input.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-import { Button } from '@instructure/ui'
-import { Avatar as AAA } from '@instructure/ui-avatar'
-import { Link } from '@instructure/ui-link'
-import { List } from '@instructure/ui-list'
-
-const fun = () => 3
-const a = (
-
-
- I should be Red
-
-
-)
-const b = Button.theme
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.output.js b/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.output.js
deleted file mode 100644
index f7e34b3400..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/themeStaticVariable.output.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-import { Button } from '@instructure/ui'
-import { Avatar as AAA } from '@instructure/ui-avatar'
-import { Link } from '@instructure/ui-link'
-import { List } from '@instructure/ui-list'
-
-import { InstUISettingsProvider } from '@instructure/emotion'
-
-const fun = () => 3
-const a = (
-
-
- I should be Red
-
-
-)
-const b = Button.componentId
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.input.tsx b/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.input.tsx
deleted file mode 100644
index 097d112f8c..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.input.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-
-const fun = () => 'asdf'
-let a = (
-
-
-
- hello
-
-
-)
-// some TS code that should not trigger parser/linter errors
-type ContentItemError = {
- field: string
- message: string
-}
-function updateSubmissionAndPageEffects(data?: {
- excuse?: boolean
- latePolicyStatus?: string
- secondsLateOverride?: number
-}) {}
diff --git a/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.output.tsx b/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.output.tsx
deleted file mode 100644
index f381d60642..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8Breaking/tsFile.output.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-import { ApplyTheme } from '@instructure/ui-themeable'
-
-import { InstUISettingsProvider } from '@instructure/emotion'
-
-const fun = () => 'asdf'
-let a = (
-
-
-
- hello
-
-
-)
-// some TS code that should not trigger parser/linter errors
-type ContentItemError = {
- field: string
- message: string
-}
-function updateSubmissionAndPageEffects(data?: {
- excuse?: boolean
- latePolicyStatus?: string
- secondsLateOverride?: number
-}) {}
diff --git a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.input.js b/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.input.js
deleted file mode 100644
index 5e12488ffb..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.input.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-import ReactDOM from 'react-dom'
-
-const aVar = () => 'hello'
-somethingElse.render(a
, 3)
-ReactDOM.render(aa
, aVar())
-ReactDOM.render(
-
- aa
-
,
- aVar())
-ReactDOM.render()
-ReactDOM.render(aVar(), "hello")
-ReactDOM.render(
- aVar,
- "hello")
-ReactDOM.render(
- "hello",
- "hello")
-ReactDOM.render(<>>, 'hello')
-ReactDOM.render(<>
>, 'hello')
diff --git a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.output.js b/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.output.js
deleted file mode 100644
index d0cfa8d8fd..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender.output.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-import ReactDOM from 'react-dom'
-
-import Root from '@canvas/react-root'
-
-const aVar = () => 'hello'
-somethingElse.render(a
, 3)
-ReactDOM.render(
-
- aa
- ,
- aVar()
-)
-ReactDOM.render(
-
- aa
- ,
- aVar()
-)
-ReactDOM.render(
-
-
-
-)
-ReactDOM.render({aVar()}, 'hello')
-ReactDOM.render({aVar}, 'hello')
-ReactDOM.render({'hello'}, 'hello')
-ReactDOM.render(<>>, 'hello')
-ReactDOM.render(
-
- <>
-
-
- >
- ,
- 'hello'
-)
diff --git a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.input.js b/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.input.js
deleted file mode 100644
index 970f6982b1..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.input.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-import { render as rrr } from 'react-dom'
-
-const aVar = () => 'hello'
-somethingElse.rrr(a
, 3)
-rrr(aa
, aVar())
-rrr(
-
- aa
-
,
- aVar())
-rrr()
-rrr(aVar(), "hello")
-rrr(
- aVar,
- "hello")
-rrr(
- "hello",
- "hello")
-rrr(<>>, 'hello')
-rrr(<>
>, 'hello')
diff --git a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.output.js b/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.output.js
deleted file mode 100644
index 81ecbef589..0000000000
--- a/packages/ui-codemods/__testfixtures__/updateV8ReactDOM/reactDOMRender2.output.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* eslint-disable */
-import { Tabs } from '@instructure/ui-tabs'
-import { Button } from '@instructure/ui'
-import { Avatar } from '@instructure/ui'
-import { render as rrr } from 'react-dom'
-
-import Root from '@canvas/react-root'
-
-const aVar = () => 'hello'
-somethingElse.rrr(a
, 3)
-rrr(
-
- aa
- ,
- aVar()
-)
-rrr(
-
- aa
- ,
- aVar()
-)
-rrr(
-
-
-
-)
-rrr({aVar()}, 'hello')
-rrr({aVar}, 'hello')
-rrr({'hello'}, 'hello')
-rrr(<>>, 'hello')
-rrr(
-
- <>
-
-
- >
- ,
- 'hello'
-)
diff --git a/packages/ui-codemods/__tests__/updateImports.test.js b/packages/ui-codemods/__tests__/updateImports.test.js
deleted file mode 100644
index 8e4a0d8375..0000000000
--- a/packages/ui-codemods/__tests__/updateImports.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import path from 'path'
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = [
- 'defaultToDefault',
- 'defaultToNamed',
- 'maintainComments',
- 'maintainImportTypes',
- 'namedToDefault',
- 'namedToNamed',
- 'noSpecifiers'
-]
-
-describe('updateImports', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updateImports',
- {
- config: path.join(__dirname, `../__testfixtures__/${test}.config.js`)
- },
- `updateImports/${test}`,
- {
- parser: 'babylon'
- }
- )
- })
-})
diff --git a/packages/ui-codemods/__tests__/updatePropNames.test.js b/packages/ui-codemods/__tests__/updatePropNames.test.js
deleted file mode 100644
index 69fdfa591b..0000000000
--- a/packages/ui-codemods/__tests__/updatePropNames.test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import path from 'path'
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = ['elements', 'updateValues']
-
-describe('updatePropNames', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updatePropNames',
- {
- config: path.join(__dirname, '../__testfixtures__/props.config.js')
- },
- `updatePropNames/${test}`
- )
- })
-})
diff --git a/packages/ui-codemods/__tests__/updateV10Breaking.test.js b/packages/ui-codemods/__tests__/updateV10Breaking.test.js
deleted file mode 100644
index e76c412fc8..0000000000
--- a/packages/ui-codemods/__tests__/updateV10Breaking.test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = ['colors', 'colors2']
-
-describe('updateV10Breaking', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updateV10Breaking',
- undefined,
- `updateV10Breaking/colors`
- )
- })
- defineTest(
- __dirname,
- 'lib/updateV10Breaking',
- {},
- `updateV10Breaking/colors2`,
- { parser: 'tsx' }
- )
-})
diff --git a/packages/ui-codemods/__tests__/updateV7Props.test.js b/packages/ui-codemods/__tests__/updateV7Props.test.js
deleted file mode 100644
index 48c2e622b7..0000000000
--- a/packages/ui-codemods/__tests__/updateV7Props.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = [
- 'helpers',
- 'buttonMisc',
- 'buttonWithText',
- 'buttonIconCircle',
- 'buttonClose',
- 'buttonLink',
- 'heading',
- 'list',
- 'pill',
- 'popover',
- 'tabs',
- 'focusableView',
- 'v7ComponentDeprecations'
-]
-
-describe('updateV7Props', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updateV7Props',
- undefined,
- `updateV7Props/${test}`
- )
- })
-})
diff --git a/packages/ui-codemods/__tests__/updateV8Breaking.test.js b/packages/ui-codemods/__tests__/updateV8Breaking.test.js
deleted file mode 100644
index 469a6d5445..0000000000
--- a/packages/ui-codemods/__tests__/updateV8Breaking.test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = ['applyTheme', 'themeStaticVariable', 'themeProp']
-
-describe('updateV8Breaking', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updateV8Breaking',
- undefined,
- `updateV8Breaking/${test}`
- )
- })
- defineTest(
- __dirname,
- 'lib/updateV8Breaking',
- undefined,
- `updateV8Breaking/tsFile`,
- { parser: 'tsx' }
- )
-})
diff --git a/packages/ui-codemods/__tests__/updateV8ReactDOM.test.js b/packages/ui-codemods/__tests__/updateV8ReactDOM.test.js
deleted file mode 100644
index 82302e6b13..0000000000
--- a/packages/ui-codemods/__tests__/updateV8ReactDOM.test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { defineTest } from 'jscodeshift/dist/testUtils'
-
-const tests = ['reactDOMRender', 'reactDOMRender2']
-
-describe('updateV8ReactDOM', () => {
- tests.forEach((test) => {
- defineTest(
- __dirname,
- 'lib/updateV8ReactDOM',
- undefined,
- `updateV8ReactDOM/${test}`
- )
- })
-})
diff --git a/packages/ui-codemods/vitest.config.ts b/packages/ui-codemods/vitest.config.ts
deleted file mode 100644
index 3dcd58b47e..0000000000
--- a/packages/ui-codemods/vitest.config.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * The MIT License (MIT).
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-///
-
-import { defineConfig } from 'vitest/config'
-
-export default defineConfig({
- test: {
- include: ['**/__tests__/**/*.test.js'],
- setupFiles: ['./ts-require-transform'],
- globals: true,
- environment: 'node'
- }
-})
diff --git a/packages/ui-color-picker/src/ColorContrast/__new-tests__/ColorContrast.test.tsx b/packages/ui-color-picker/src/ColorContrast/__tests__/ColorContrast.test.tsx
similarity index 100%
rename from packages/ui-color-picker/src/ColorContrast/__new-tests__/ColorContrast.test.tsx
rename to packages/ui-color-picker/src/ColorContrast/__tests__/ColorContrast.test.tsx
diff --git a/packages/ui-color-picker/src/ColorIndicator/__new-tests__/ColorIndicator.test.tsx b/packages/ui-color-picker/src/ColorIndicator/__tests__/ColorIndicator.test.tsx
similarity index 100%
rename from packages/ui-color-picker/src/ColorIndicator/__new-tests__/ColorIndicator.test.tsx
rename to packages/ui-color-picker/src/ColorIndicator/__tests__/ColorIndicator.test.tsx
diff --git a/packages/ui-color-picker/src/ColorMixer/__new-tests__/ColorMixer.test.tsx b/packages/ui-color-picker/src/ColorMixer/__tests__/ColorMixer.test.tsx
similarity index 100%
rename from packages/ui-color-picker/src/ColorMixer/__new-tests__/ColorMixer.test.tsx
rename to packages/ui-color-picker/src/ColorMixer/__tests__/ColorMixer.test.tsx
diff --git a/packages/ui-color-picker/src/ColorPicker/__new-tests__/ColorPicker.test.tsx b/packages/ui-color-picker/src/ColorPicker/__tests__/ColorPicker.test.tsx
similarity index 100%
rename from packages/ui-color-picker/src/ColorPicker/__new-tests__/ColorPicker.test.tsx
rename to packages/ui-color-picker/src/ColorPicker/__tests__/ColorPicker.test.tsx
diff --git a/packages/ui-color-picker/src/ColorPreset/__new-tests__/ColorPreset.test.tsx b/packages/ui-color-picker/src/ColorPreset/__tests__/ColorPreset.test.tsx
similarity index 100%
rename from packages/ui-color-picker/src/ColorPreset/__new-tests__/ColorPreset.test.tsx
rename to packages/ui-color-picker/src/ColorPreset/__tests__/ColorPreset.test.tsx
diff --git a/packages/ui-color-utils/package.json b/packages/ui-color-utils/package.json
index ec89b3d39a..79b4b197bb 100644
--- a/packages/ui-color-utils/package.json
+++ b/packages/ui-color-utils/package.json
@@ -23,7 +23,6 @@
"license": "MIT",
"devDependencies": {
"@instructure/ui-babel-preset": "10.19.1",
- "@instructure/ui-test-utils": "10.19.1",
"@types/tinycolor2": "^1.4.6"
},
"dependencies": {
diff --git a/packages/ui-color-utils/tsconfig.build.json b/packages/ui-color-utils/tsconfig.build.json
index 9032019a1f..d24a52057c 100644
--- a/packages/ui-color-utils/tsconfig.build.json
+++ b/packages/ui-color-utils/tsconfig.build.json
@@ -10,9 +10,5 @@
{
"path": "../ui-babel-preset/tsconfig.build.json"
},
-
- {
- "path": "../ui-test-utils/tsconfig.build.json"
- }
]
}
diff --git a/packages/ui-date-input/src/DateInput/__new-tests__/DateInput.test.tsx b/packages/ui-date-input/src/DateInput/__tests__/DateInput.test.tsx
similarity index 100%
rename from packages/ui-date-input/src/DateInput/__new-tests__/DateInput.test.tsx
rename to packages/ui-date-input/src/DateInput/__tests__/DateInput.test.tsx
diff --git a/packages/ui-date-input/src/DateInput2/__new-tests__/DateInput2.test.tsx b/packages/ui-date-input/src/DateInput2/__tests__/DateInput2.test.tsx
similarity index 100%
rename from packages/ui-date-input/src/DateInput2/__new-tests__/DateInput2.test.tsx
rename to packages/ui-date-input/src/DateInput2/__tests__/DateInput2.test.tsx
diff --git a/packages/ui-date-time-input/src/DateTimeInput/__new-tests__/DateTimeInput.test.tsx b/packages/ui-date-time-input/src/DateTimeInput/__tests__/DateTimeInput.test.tsx
similarity index 100%
rename from packages/ui-date-time-input/src/DateTimeInput/__new-tests__/DateTimeInput.test.tsx
rename to packages/ui-date-time-input/src/DateTimeInput/__tests__/DateTimeInput.test.tsx
diff --git a/packages/ui-dialog/src/Dialog/__new-tests__/Dialog.test.tsx b/packages/ui-dialog/src/Dialog/__tests__/Dialog.test.tsx
similarity index 100%
rename from packages/ui-dialog/src/Dialog/__new-tests__/Dialog.test.tsx
rename to packages/ui-dialog/src/Dialog/__tests__/Dialog.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/addEventListener.test.tsx b/packages/ui-dom-utils/src/__tests__/addEventListener.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/addEventListener.test.tsx
rename to packages/ui-dom-utils/src/__tests__/addEventListener.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/addInputModeListener.test.tsx b/packages/ui-dom-utils/src/__tests__/addInputModeListener.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/addInputModeListener.test.tsx
rename to packages/ui-dom-utils/src/__tests__/addInputModeListener.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/addPositionChangeListener.test.tsx b/packages/ui-dom-utils/src/__tests__/addPositionChangeListener.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/addPositionChangeListener.test.tsx
rename to packages/ui-dom-utils/src/__tests__/addPositionChangeListener.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/findTabbable.test.tsx b/packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/findTabbable.test.tsx
rename to packages/ui-dom-utils/src/__tests__/findTabbable.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/getClassList.test.tsx b/packages/ui-dom-utils/src/__tests__/getClassList.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/getClassList.test.tsx
rename to packages/ui-dom-utils/src/__tests__/getClassList.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/getFontSize.test.tsx b/packages/ui-dom-utils/src/__tests__/getFontSize.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/getFontSize.test.tsx
rename to packages/ui-dom-utils/src/__tests__/getFontSize.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/getOffsetParents.test.tsx b/packages/ui-dom-utils/src/__tests__/getOffsetParents.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/getOffsetParents.test.tsx
rename to packages/ui-dom-utils/src/__tests__/getOffsetParents.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/getScrollParents.test.tsx b/packages/ui-dom-utils/src/__tests__/getScrollParents.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/getScrollParents.test.tsx
rename to packages/ui-dom-utils/src/__tests__/getScrollParents.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/isCustomElement.test.tsx b/packages/ui-dom-utils/src/__tests__/isCustomElement.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/isCustomElement.test.tsx
rename to packages/ui-dom-utils/src/__tests__/isCustomElement.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/isVisible.test.tsx b/packages/ui-dom-utils/src/__tests__/isVisible.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/isVisible.test.tsx
rename to packages/ui-dom-utils/src/__tests__/isVisible.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/requestAnimationFrame.test.tsx b/packages/ui-dom-utils/src/__tests__/requestAnimationFrame.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/requestAnimationFrame.test.tsx
rename to packages/ui-dom-utils/src/__tests__/requestAnimationFrame.test.tsx
diff --git a/packages/ui-dom-utils/src/__new-tests__/transformSelection.test.tsx b/packages/ui-dom-utils/src/__tests__/transformSelection.test.tsx
similarity index 100%
rename from packages/ui-dom-utils/src/__new-tests__/transformSelection.test.tsx
rename to packages/ui-dom-utils/src/__tests__/transformSelection.test.tsx
diff --git a/packages/ui-drawer-layout/src/DrawerLayout/DrawerContent/__new-tests__/DrawerContent.test.tsx b/packages/ui-drawer-layout/src/DrawerLayout/DrawerContent/__tests__/DrawerContent.test.tsx
similarity index 100%
rename from packages/ui-drawer-layout/src/DrawerLayout/DrawerContent/__new-tests__/DrawerContent.test.tsx
rename to packages/ui-drawer-layout/src/DrawerLayout/DrawerContent/__tests__/DrawerContent.test.tsx
diff --git a/packages/ui-drawer-layout/src/DrawerLayout/DrawerTray/__new-tests__/DrawerTray.test.tsx b/packages/ui-drawer-layout/src/DrawerLayout/DrawerTray/__tests__/DrawerTray.test.tsx
similarity index 100%
rename from packages/ui-drawer-layout/src/DrawerLayout/DrawerTray/__new-tests__/DrawerTray.test.tsx
rename to packages/ui-drawer-layout/src/DrawerLayout/DrawerTray/__tests__/DrawerTray.test.tsx
diff --git a/packages/ui-drawer-layout/src/DrawerLayout/__new-tests__/DrawerLayout.test.tsx b/packages/ui-drawer-layout/src/DrawerLayout/__tests__/DrawerLayout.test.tsx
similarity index 100%
rename from packages/ui-drawer-layout/src/DrawerLayout/__new-tests__/DrawerLayout.test.tsx
rename to packages/ui-drawer-layout/src/DrawerLayout/__tests__/DrawerLayout.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.tsx b/packages/ui-drilldown/src/Drilldown/DrilldownGroup/__tests__/DrilldownGroup.test.tsx
similarity index 100%
rename from packages/ui-drilldown/src/Drilldown/DrilldownGroup/__new-tests__/DrilldownGroup.test.tsx
rename to packages/ui-drilldown/src/Drilldown/DrilldownGroup/__tests__/DrilldownGroup.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.tsx b/packages/ui-drilldown/src/Drilldown/DrilldownOption/__tests__/DrilldownOption.test.tsx
similarity index 100%
rename from packages/ui-drilldown/src/Drilldown/DrilldownOption/__new-tests__/DrilldownOption.test.tsx
rename to packages/ui-drilldown/src/Drilldown/DrilldownOption/__tests__/DrilldownOption.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.tsx b/packages/ui-drilldown/src/Drilldown/DrilldownPage/__tests__/DrilldownPage.test.tsx
similarity index 100%
rename from packages/ui-drilldown/src/Drilldown/DrilldownPage/__new-tests__/DrilldownPage.test.tsx
rename to packages/ui-drilldown/src/Drilldown/DrilldownPage/__tests__/DrilldownPage.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.tsx b/packages/ui-drilldown/src/Drilldown/DrilldownSeparator/__tests__/DrilldownSeparator.test.tsx
similarity index 100%
rename from packages/ui-drilldown/src/Drilldown/DrilldownSeparator/__new-tests__/DrilldownSeparator.test.tsx
rename to packages/ui-drilldown/src/Drilldown/DrilldownSeparator/__tests__/DrilldownSeparator.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/__new-tests__/Drilldown.test.tsx b/packages/ui-drilldown/src/Drilldown/__tests__/Drilldown.test.tsx
similarity index 100%
rename from packages/ui-drilldown/src/Drilldown/__new-tests__/Drilldown.test.tsx
rename to packages/ui-drilldown/src/Drilldown/__tests__/Drilldown.test.tsx
diff --git a/packages/ui-drilldown/src/Drilldown/__tests__/theme.test.ts b/packages/ui-drilldown/src/Drilldown/__tests__/theme.test.ts
deleted file mode 100644
index 20fbc554b1..0000000000
--- a/packages/ui-drilldown/src/Drilldown/__tests__/theme.test.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { optionsThemeGenerator } from '@instructure/ui-options'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Drilldown.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
- const optionsVariables = optionsThemeGenerator(canvas)
-
- describe('default color', () => {
- it('should ensure background color and text color meet 3:1 contrast', () => {
- expect(
- contrast(optionsVariables.background, variables.headerActionColor)
- ).to.be.above(3)
- })
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
- const optionsVariables = optionsThemeGenerator(canvas)
-
- describe('default color', () => {
- it('should ensure background color and text color meet 4.5:1 contrast', () => {
- expect(
- contrast(optionsVariables.background, variables.headerActionColor)
- ).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-editable/src/Editable/__new-tests__/Editable.test.tsx b/packages/ui-editable/src/Editable/__tests__/Editable.test.tsx
similarity index 100%
rename from packages/ui-editable/src/Editable/__new-tests__/Editable.test.tsx
rename to packages/ui-editable/src/Editable/__tests__/Editable.test.tsx
diff --git a/packages/ui-editable/src/InPlaceEdit/__new-tests__/InPlaceEdit.test.tsx b/packages/ui-editable/src/InPlaceEdit/__tests__/InPlaceEdit.test.tsx
similarity index 100%
rename from packages/ui-editable/src/InPlaceEdit/__new-tests__/InPlaceEdit.test.tsx
rename to packages/ui-editable/src/InPlaceEdit/__tests__/InPlaceEdit.test.tsx
diff --git a/packages/ui-expandable/src/Expandable/__new-tests__/Expandable.test.tsx b/packages/ui-expandable/src/Expandable/__tests__/Expandable.test.tsx
similarity index 100%
rename from packages/ui-expandable/src/Expandable/__new-tests__/Expandable.test.tsx
rename to packages/ui-expandable/src/Expandable/__tests__/Expandable.test.tsx
diff --git a/packages/ui-file-drop/src/FileDrop/__new-tests__/FileDrop.test.tsx b/packages/ui-file-drop/src/FileDrop/__tests__/FileDrop.test.tsx
similarity index 100%
rename from packages/ui-file-drop/src/FileDrop/__new-tests__/FileDrop.test.tsx
rename to packages/ui-file-drop/src/FileDrop/__tests__/FileDrop.test.tsx
diff --git a/packages/ui-file-drop/src/FileDrop/__tests__/theme.test.ts b/packages/ui-file-drop/src/FileDrop/__tests__/theme.test.ts
deleted file mode 100644
index b910614d37..0000000000
--- a/packages/ui-file-drop/src/FileDrop/__tests__/theme.test.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import generateComponentTheme from '../theme'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-describe('FileDrop.theme', () => {
- describe('with the canvas theme', () => {
- const variables = generateComponentTheme(canvas)
- it('should have background and hover highlight colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.hoverBorderColor)
- ).to.be.above(3)
- })
- it('should have background and accepted highlight colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.acceptedColor)
- ).to.be.above(3)
- })
- it('should have background and rejected highlight colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.rejectedColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
- it('should have background and hover highlight colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.hoverBorderColor)
- ).to.be.above(4.5)
- })
- it('should have background and accepted highlight colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.acceptedColor)
- ).to.be.above(4.5)
- })
- it('should have background and rejected highlight colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.rejectedColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-file-drop/src/FileDrop/utils/__new-tests__/accepts.test.tsx b/packages/ui-file-drop/src/FileDrop/utils/__tests__/accepts.test.tsx
similarity index 100%
rename from packages/ui-file-drop/src/FileDrop/utils/__new-tests__/accepts.test.tsx
rename to packages/ui-file-drop/src/FileDrop/utils/__tests__/accepts.test.tsx
diff --git a/packages/ui-file-drop/src/FileDrop/utils/__new-tests__/getEventFiles.test.tsx b/packages/ui-file-drop/src/FileDrop/utils/__tests__/getEventFiles.test.tsx
similarity index 100%
rename from packages/ui-file-drop/src/FileDrop/utils/__new-tests__/getEventFiles.test.tsx
rename to packages/ui-file-drop/src/FileDrop/utils/__tests__/getEventFiles.test.tsx
diff --git a/packages/ui-flex/src/Flex/Item/__new-tests__/FlexItem.test.tsx b/packages/ui-flex/src/Flex/Item/__tests__/FlexItem.test.tsx
similarity index 100%
rename from packages/ui-flex/src/Flex/Item/__new-tests__/FlexItem.test.tsx
rename to packages/ui-flex/src/Flex/Item/__tests__/FlexItem.test.tsx
diff --git a/packages/ui-flex/src/Flex/__new-tests__/Flex.test.tsx b/packages/ui-flex/src/Flex/__tests__/Flex.test.tsx
similarity index 100%
rename from packages/ui-flex/src/Flex/__new-tests__/Flex.test.tsx
rename to packages/ui-flex/src/Flex/__tests__/Flex.test.tsx
diff --git a/packages/ui-focusable/src/Focusable/__new-tests__/Focusable.test.tsx b/packages/ui-focusable/src/Focusable/__new-tests__/Focusable.test.tsx
deleted file mode 100644
index 454dd5a540..0000000000
--- a/packages/ui-focusable/src/Focusable/__new-tests__/Focusable.test.tsx
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { Component } from 'react'
-import { render, screen, waitFor } from '@testing-library/react'
-import userEvent from '@testing-library/user-event'
-import { vi } from 'vitest'
-import type { MockInstance } from 'vitest'
-import '@testing-library/jest-dom'
-
-import { Focusable } from '../index'
-import type { FocusableRenderOptions } from '../props'
-
-describe('', () => {
- let consoleWarningMock: ReturnType
- let consoleErrorMock: ReturnType
-
- beforeEach(() => {
- // Mocking console to prevent test output pollution and expect for messages
- consoleWarningMock = vi
- .spyOn(console, 'warn')
- .mockImplementation(() => {}) as MockInstance
-
- consoleErrorMock = vi
- .spyOn(console, 'error')
- .mockImplementation(() => {}) as MockInstance
- })
-
- afterEach(() => {
- consoleWarningMock.mockRestore()
- consoleErrorMock.mockRestore()
- })
-
- it('should render', async () => {
- render({() => })
- const button = screen.getByRole('button')
-
- expect(button).toBeInTheDocument()
- expect(button).toHaveTextContent('hello world')
- })
-
- it('should call children function with focused when element receives focus', async () => {
- const renderSpy = vi.fn()
- render(
-
- {(args) => {
- renderSpy(args)
- return
- }}
-
- )
- const focusable = screen.getByRole('button')
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args).toHaveProperty('focused', false)
- expect(args).toHaveProperty('focusable', focusable)
- expect(args).toHaveProperty('focusVisible', false)
- })
-
- await userEvent.type(focusable, '{enter}')
- await focusable.focus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(document.activeElement).toBe(focusable)
- expect(args).toHaveProperty('focused', true)
- expect(args).toHaveProperty('focusable', focusable)
- expect(args).toHaveProperty('focusVisible', true)
- })
-
- await focusable.blur()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(document.activeElement).not.toBe(focusable)
- expect(args).toHaveProperty('focused', false)
- expect(args).toHaveProperty('focusable', focusable)
- expect(args).toHaveProperty('focusVisible', false)
- })
- })
-
- it('should handle conditionally rendered focus elements', async () => {
- const renderSpy = vi.fn(({ focused }) => (
-
- ))
-
- render()
- const firstFocusable = screen.getByText('Click')
-
- expect(firstFocusable.tagName).toBe('A')
- expect(firstFocusable).not.toHaveFocus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(false)
- expect(args.focusable).toBe(firstFocusable)
- })
-
- await firstFocusable.focus()
-
- const nextFocusable = screen.getByRole('textbox')
-
- expect(nextFocusable.tagName).toBe('INPUT')
- expect(nextFocusable).toHaveFocus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
- expect(args.focused).toBe(true)
- expect(args.focusable).toBe(nextFocusable)
- })
-
- await nextFocusable.blur()
-
- const lastFocusable = screen.getByText('Click')
-
- expect(lastFocusable.tagName).toBe('A')
- expect(lastFocusable).not.toHaveFocus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
- expect(args.focused).toBe(false)
- expect(args.focusable).toBe(lastFocusable)
- })
- })
-
- it('should maintain focus when the focus element changes', async () => {
- const renderSpy = vi.fn(() => Click)
-
- const { rerender } = render()
- const firstFocusable = screen.getByText('Click')
-
- await firstFocusable.focus()
-
- await waitFor(() => {
- const lastCall = renderSpy.mock.lastCall as
- | [{ focused: boolean; focusable: HTMLElement }]
- | undefined
- const args = lastCall?.[0]
-
- expect(firstFocusable).toHaveFocus()
- expect(args?.focused).toBe(true)
- expect(args?.focusable).toBe(firstFocusable)
- })
-
- // Set prop: render
- const nextRenderSpy = vi.fn(() => )
- rerender()
-
- const nextFocusable = screen.getByText('Click')
-
- expect(nextFocusable.tagName).toBe('BUTTON')
- expect(nextFocusable).toHaveFocus()
-
- await waitFor(() => {
- const nextLastCall = nextRenderSpy.mock.lastCall as
- | [{ focused: boolean; focusable: HTMLElement }]
- | undefined
- const nextArgs = nextLastCall?.[0]
-
- expect(nextFocusable).toHaveFocus()
- expect(nextArgs?.focused).toBe(true)
- expect(nextArgs?.focusable).toBe(nextFocusable)
- })
- })
-
- it('should update the focus element correctly', async () => {
- const renderSpy = vi.fn()
-
- const { rerender } = render(
-
- {(args) => {
- renderSpy(args)
- return
- }}
-
- )
-
- const firstButton = screen.getByText('foo')
-
- await firstButton.focus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(true)
- })
-
- await firstButton.blur()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(false)
- })
-
- // Set child
- rerender(
-
- {(args: FocusableRenderOptions) => {
- renderSpy(args)
- return (
-
- some content text
-
- )
- }}
-
- )
- const secondButton = screen.getByText('bar')
-
- await secondButton.focus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(true)
- })
- })
-
- it('should warn when there is more than one focusable descendant', async () => {
- render(
-
- {() => {
- return (
-
-
-
-
-
-
- )
- }}
-
- )
-
- const expectedWarningMessage =
- 'Warning: [Focusable] Exactly one focusable child is required (2 found).'
-
- expect(consoleWarningMock).toHaveBeenCalledWith(
- expect.stringContaining(expectedWarningMessage),
- expect.any(String)
- )
- })
-
- it('should warn when there are no focusable descendants', async () => {
- render(
-
- {() => {
- return hello!
- }}
-
- )
-
- const expectedWarningMessage =
- 'Warning: [Focusable] Exactly one focusable child is required (0 found).'
-
- expect(consoleWarningMock).toHaveBeenCalledWith(
- expect.stringContaining(expectedWarningMessage),
- expect.any(String)
- )
- })
-
- it('should attach event listener correctly even when the focusable element is not the root', async () => {
- const renderSpy = vi.fn()
-
- render(
-
- {(args) => {
- renderSpy(args)
- return (
-
- hello world
- some content
-
-
-
-
- )
- }}
-
- )
-
- const button = screen.getByRole('button')
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(false)
- })
-
- await button.focus()
-
- await waitFor(() => {
- const args = renderSpy.mock.lastCall![0]
-
- expect(args.focused).toBe(true)
- })
- })
-
- it('should provide a focus method', async () => {
- let focusable: Focusable
- render(
- {
- focusable = el
- }}
- >
- {() => }
-
- )
-
- await focusable!.focus()
-
- const button = screen.getByText('hello world')
-
- expect(button).toHaveFocus()
- })
-
- it('should provide a focused getter', async () => {
- let focusableInstance: any
-
- render(
-
- {(args) => {
- focusableInstance = args
- return
- }}
-
- )
- const button = screen.getByText('Click me')
-
- expect(focusableInstance?.focused).toBe(false)
-
- await button.focus()
-
- await waitFor(() => {
- expect(focusableInstance?.focused).toBe(true)
- expect(button).toHaveFocus()
- })
- })
-
- it('should properly restore the event handlers', async () => {
- let inputRef: HTMLInputElement | null = null
- class TestComponent extends Component<{ changeValue: string }> {
- render() {
- const { changeValue } = this.props
-
- return (
-
- {({ focusVisible }) => {
- return (
- {
- inputRef = el
- }}
- value={`${focusVisible}_${changeValue}`}
- />
- )
- }}
-
- )
- }
- }
- const { rerender, container } = render()
- const initialInput = container.querySelector('input')
-
- await waitFor(() => {
- expect(initialInput).toHaveValue('false_A')
- })
-
- // Set Prop: changeValue
- rerender()
-
- await inputRef!.focus()
-
- await waitFor(() => {
- expect(inputRef).toHaveValue('true_B')
- })
- })
-
- it('should properly clear the focusable / focused state when focus is unexpectedly lost', async () => {
- let buttonRef: HTMLButtonElement | null
- let focusableRef: Focusable | null
- let labelRef: HTMLLabelElement | null
-
- class TestComponent extends Component {
- state = {
- checked: false,
- disabled: false
- }
-
- render() {
- const { checked, disabled } = this.state
-
- return (
-
- {
- focusableRef = el
- }}
- >
- {() => {
- return (
-
- )
- }}
-
-
-
- )
- }
- }
-
- const { container } = render()
- const input = container.querySelector('input')
-
- await waitFor(() => {
- expect(focusableRef!.focused).toBe(false)
- })
-
- await userEvent.click(labelRef!)
-
- await waitFor(() => {
- expect(input).toHaveFocus()
- })
-
- await userEvent.click(buttonRef!)
-
- await waitFor(() => {
- expect(input).not.toHaveFocus()
- })
- })
-})
diff --git a/packages/ui-focusable/src/Focusable/__tests__/Focusable.test.tsx b/packages/ui-focusable/src/Focusable/__tests__/Focusable.test.tsx
index fbd403dbcd..454dd5a540 100644
--- a/packages/ui-focusable/src/Focusable/__tests__/Focusable.test.tsx
+++ b/packages/ui-focusable/src/Focusable/__tests__/Focusable.test.tsx
@@ -23,32 +23,46 @@
*/
import { Component } from 'react'
-
-import {
- expect,
- find,
- mount,
- spy,
- stub,
- wait
-} from '@instructure/ui-test-utils'
+import { render, screen, waitFor } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { vi } from 'vitest'
+import type { MockInstance } from 'vitest'
+import '@testing-library/jest-dom'
import { Focusable } from '../index'
import type { FocusableRenderOptions } from '../props'
-describe('', async () => {
- const lastCall = (spy: any) => spy.lastCall.args[0]
+describe('', () => {
+ let consoleWarningMock: ReturnType
+ let consoleErrorMock: ReturnType
+
+ beforeEach(() => {
+ // Mocking console to prevent test output pollution and expect for messages
+ consoleWarningMock = vi
+ .spyOn(console, 'warn')
+ .mockImplementation(() => {}) as MockInstance
+
+ consoleErrorMock = vi
+ .spyOn(console, 'error')
+ .mockImplementation(() => {}) as MockInstance
+ })
+
+ afterEach(() => {
+ consoleWarningMock.mockRestore()
+ consoleErrorMock.mockRestore()
+ })
it('should render', async () => {
- const subject = await mount(
- {() => }
- )
- expect(subject.getDOMNode()).to.exist()
+ render({() => })
+ const button = screen.getByRole('button')
+
+ expect(button).toBeInTheDocument()
+ expect(button).toHaveTextContent('hello world')
})
it('should call children function with focused when element receives focus', async () => {
- const renderSpy = spy()
- await mount(
+ const renderSpy = vi.fn()
+ render(
{(args) => {
renderSpy(args)
@@ -56,160 +70,131 @@ describe('', async () => {
}}
)
+ const focusable = screen.getByRole('button')
- const focusable = await find(':focusable')
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.be.false()
- expect(lastCall(renderSpy).focusable).to.equal(focusable.getDOMNode())
- expect(lastCall(renderSpy).focusVisible).to.be.false()
+ expect(args).toHaveProperty('focused', false)
+ expect(args).toHaveProperty('focusable', focusable)
+ expect(args).toHaveProperty('focusVisible', false)
})
- await focusable.keyDown() // make sure we're back in keyboard mode
+ await userEvent.type(focusable, '{enter}')
await focusable.focus()
- await wait(() => {
- expect(focusable.focused()).to.be.true()
- expect(lastCall(renderSpy).focused).to.be.true()
- expect(lastCall(renderSpy).focusable).to.equal(focusable.getDOMNode())
-
- expect(lastCall(renderSpy).focusVisible).to.be.true()
- })
-
- await focusable.blur({}, { simulate: true })
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
- await wait(() => {
- expect(focusable.focused()).to.be.false()
- expect(lastCall(renderSpy).focused).to.equal(false)
- expect(lastCall(renderSpy).focusable).to.equal(focusable.getDOMNode())
- expect(lastCall(renderSpy).focusVisible).to.equal(false)
+ expect(document.activeElement).toBe(focusable)
+ expect(args).toHaveProperty('focused', true)
+ expect(args).toHaveProperty('focusable', focusable)
+ expect(args).toHaveProperty('focusVisible', true)
})
- })
-
- it('should populate the focusVisible argument', async () => {
- const renderSpy = spy()
-
- await mount(
-
- {(args) => {
- renderSpy(args)
- return
- }}
-
- )
- const focusable = await find(':focusable')
+ await focusable.blur()
- await focusable.mouseDown()
- await focusable.focus()
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.equal(true)
- expect(lastCall(renderSpy).focusVisible).to.equal(false)
+ expect(document.activeElement).not.toBe(focusable)
+ expect(args).toHaveProperty('focused', false)
+ expect(args).toHaveProperty('focusable', focusable)
+ expect(args).toHaveProperty('focusVisible', false)
})
})
it('should handle conditionally rendered focus elements', async () => {
- const props = {
- render: ({ focused }: { focused: boolean }) => {
- return (
-
- {focused ? (
-
- ) : (
-
Click
- )}
-
- )
- }
- }
+ const renderSpy = vi.fn(({ focused }) => (
+
+ ))
- const renderSpy = spy(props, 'render')
+ render()
+ const firstFocusable = screen.getByText('Click')
- await mount()
+ expect(firstFocusable.tagName).toBe('A')
+ expect(firstFocusable).not.toHaveFocus()
- const firstFocusable = await find(':focusable')
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
- expect(firstFocusable.getTagName()).to.equal('a')
- expect(firstFocusable.focused()).to.be.false()
-
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.be.false()
- expect(lastCall(renderSpy).focusable).to.equal(
- firstFocusable.getDOMNode()
- )
+ expect(args.focused).toBe(false)
+ expect(args.focusable).toBe(firstFocusable)
})
await firstFocusable.focus()
- const nextFocusable = await find(':focusable')
+ const nextFocusable = screen.getByRole('textbox')
- expect(nextFocusable.getTagName()).to.equal('input')
- expect(nextFocusable.focused()).to.be.true()
+ expect(nextFocusable.tagName).toBe('INPUT')
+ expect(nextFocusable).toHaveFocus()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.be.true()
- expect(lastCall(renderSpy).focusable).to.equal(nextFocusable.getDOMNode())
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+ expect(args.focused).toBe(true)
+ expect(args.focusable).toBe(nextFocusable)
})
- await nextFocusable.blur({}, { simulate: true })
+ await nextFocusable.blur()
- const lastFocusable = await find(':focusable')
+ const lastFocusable = screen.getByText('Click')
- expect(lastFocusable.getTagName()).to.equal('a')
- expect(lastFocusable.focused()).to.be.false()
+ expect(lastFocusable.tagName).toBe('A')
+ expect(lastFocusable).not.toHaveFocus()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.be.false()
- expect(lastCall(renderSpy).focusable).to.equal(lastFocusable.getDOMNode())
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+ expect(args.focused).toBe(false)
+ expect(args.focusable).toBe(lastFocusable)
})
})
it('should maintain focus when the focus element changes', async () => {
- const props = {
- render: () => {
- return Click
- }
- }
-
- const renderSpy = spy(props, 'render')
+ const renderSpy = vi.fn(() => Click)
- const subject = await mount()
+ const { rerender } = render()
+ const firstFocusable = screen.getByText('Click')
- const firstFocusable = await find(':focusable')
await firstFocusable.focus()
- await wait(() => {
- expect(firstFocusable.focused()).to.be.true()
- expect(lastCall(renderSpy).focused).to.be.true()
- expect(lastCall(renderSpy).focusable).to.equal(
- firstFocusable.getDOMNode()
- )
+ await waitFor(() => {
+ const lastCall = renderSpy.mock.lastCall as
+ | [{ focused: boolean; focusable: HTMLElement }]
+ | undefined
+ const args = lastCall?.[0]
+
+ expect(firstFocusable).toHaveFocus()
+ expect(args?.focused).toBe(true)
+ expect(args?.focusable).toBe(firstFocusable)
})
- const nextProps = {
- render: () =>
- }
+ // Set prop: render
+ const nextRenderSpy = vi.fn(() => )
+ rerender()
+
+ const nextFocusable = screen.getByText('Click')
- const nextRenderSpy = spy(nextProps, 'render')
- await subject.setProps(nextProps)
+ expect(nextFocusable.tagName).toBe('BUTTON')
+ expect(nextFocusable).toHaveFocus()
- const nextFocusable = await find(':focusable')
- expect(nextFocusable.getTagName()).to.equal('button')
- expect(nextFocusable.focused()).to.be.true()
+ await waitFor(() => {
+ const nextLastCall = nextRenderSpy.mock.lastCall as
+ | [{ focused: boolean; focusable: HTMLElement }]
+ | undefined
+ const nextArgs = nextLastCall?.[0]
- await wait(() => {
- expect(lastCall(nextRenderSpy).focused).to.be.true()
- expect(lastCall(nextRenderSpy).focusable).to.equal(
- nextFocusable.getDOMNode()
- )
+ expect(nextFocusable).toHaveFocus()
+ expect(nextArgs?.focused).toBe(true)
+ expect(nextArgs?.focusable).toBe(nextFocusable)
})
})
it('should update the focus element correctly', async () => {
- const renderSpy = spy()
+ const renderSpy = vi.fn()
- const subject = await mount(
+ const { rerender } = render(
{(args) => {
renderSpy(args)
@@ -218,45 +203,50 @@ describe('', async () => {
)
- const firstButton = await find('button:label(foo)')
+ const firstButton = screen.getByText('foo')
await firstButton.focus()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.equal(true)
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+
+ expect(args.focused).toBe(true)
})
- await firstButton.blur({}, { simulate: true })
+ await firstButton.blur()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.equal(false)
- })
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
- await subject.setProps({
- children: (args: FocusableRenderOptions) => {
- renderSpy(args)
- return (
-
- some content text
-
- )
- }
+ expect(args.focused).toBe(false)
})
- const secondButton = await find('button:label(bar)')
+ // Set child
+ rerender(
+
+ {(args: FocusableRenderOptions) => {
+ renderSpy(args)
+ return (
+
+ some content text
+
+ )
+ }}
+
+ )
+ const secondButton = screen.getByText('bar')
await secondButton.focus()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.equal(true)
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+
+ expect(args.focused).toBe(true)
})
})
it('should warn when there is more than one focusable descendant', async () => {
- const consoleWarn = stub(console, 'warn')
- const warning =
- 'Warning: [Focusable] Exactly one focusable child is required (2 found).'
- await mount(
+ render(
{() => {
return (
@@ -270,27 +260,38 @@ describe('', async () => {
}}
)
- expect(consoleWarn).to.be.calledWith(warning)
+
+ const expectedWarningMessage =
+ 'Warning: [Focusable] Exactly one focusable child is required (2 found).'
+
+ expect(consoleWarningMock).toHaveBeenCalledWith(
+ expect.stringContaining(expectedWarningMessage),
+ expect.any(String)
+ )
})
it('should warn when there are no focusable descendants', async () => {
- const consoleWarn = stub(console, 'warn')
- const warning =
- 'Warning: [Focusable] Exactly one focusable child is required (0 found).'
- await mount(
+ render(
{() => {
return hello!
}}
)
- expect(consoleWarn).to.be.calledWith(warning)
+
+ const expectedWarningMessage =
+ 'Warning: [Focusable] Exactly one focusable child is required (0 found).'
+
+ expect(consoleWarningMock).toHaveBeenCalledWith(
+ expect.stringContaining(expectedWarningMessage),
+ expect.any(String)
+ )
})
it('should attach event listener correctly even when the focusable element is not the root', async () => {
- const renderSpy = spy()
+ const renderSpy = vi.fn()
- await mount(
+ render(
{(args) => {
renderSpy(args)
@@ -307,22 +308,28 @@ describe('', async () => {
)
- expect(lastCall(renderSpy).focused).to.equal(false)
+ const button = screen.getByRole('button')
+
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+
+ expect(args.focused).toBe(false)
+ })
- const button = await find('button:label(foo)')
await button.focus()
- await wait(() => {
- expect(lastCall(renderSpy).focused).to.equal(true)
+ await waitFor(() => {
+ const args = renderSpy.mock.lastCall![0]
+
+ expect(args.focused).toBe(true)
})
})
it('should provide a focus method', async () => {
let focusable: Focusable
- await mount(
+ render(
{
+ ref={(el: Focusable) => {
focusable = el
}}
>
@@ -332,33 +339,36 @@ describe('', async () => {
await focusable!.focus()
- const button = await find('button:label(hello world)')
+ const button = screen.getByText('hello world')
- expect(button.getDOMNode()).to.equal(document.activeElement)
+ expect(button).toHaveFocus()
})
it('should provide a focused getter', async () => {
- let focusable: Focusable
+ let focusableInstance: any
- await mount(
- {
- focusable = el
+ render(
+
+ {(args) => {
+ focusableInstance = args
+ return
}}
- >
- {() => }
)
+ const button = screen.getByText('Click me')
- await focusable!.focus()
+ expect(focusableInstance?.focused).toBe(false)
- expect(focusable!.focused).to.equal(true)
+ await button.focus()
+
+ await waitFor(() => {
+ expect(focusableInstance?.focused).toBe(true)
+ expect(button).toHaveFocus()
+ })
})
it('should properly restore the event handlers', async () => {
- let inputRef: HTMLInputElement | null
-
+ let inputRef: HTMLInputElement | null = null
class TestComponent extends Component<{ changeValue: string }> {
render() {
const { changeValue } = this.props
@@ -380,20 +390,20 @@ describe('', async () => {
)
}
}
+ const { rerender, container } = render()
+ const initialInput = container.querySelector('input')
- const subject = await mount()
- await wait(() => {
- expect(inputRef!.value).to.equal('false_A')
+ await waitFor(() => {
+ expect(initialInput).toHaveValue('false_A')
})
- await subject.setProps({
- changeValue: 'B'
- })
+ // Set Prop: changeValue
+ rerender()
await inputRef!.focus()
- await wait(() => {
- expect(inputRef!.value).to.equal('true_B')
+ await waitFor(() => {
+ expect(inputRef).toHaveValue('true_B')
})
})
@@ -453,21 +463,23 @@ describe('', async () => {
}
}
- await mount()
- await wait(() => {
- expect(focusableRef!.focused).to.equal(false)
+ const { container } = render()
+ const input = container.querySelector('input')
+
+ await waitFor(() => {
+ expect(focusableRef!.focused).toBe(false)
})
- const input = await find('input[type="checkbox"]')
+ await userEvent.click(labelRef!)
- await labelRef!.click()
- await wait(() => {
- expect(input.focused()).to.equal(true)
+ await waitFor(() => {
+ expect(input).toHaveFocus()
})
- await buttonRef!.click()
- await wait(() => {
- expect(input.focused()).to.equal(false)
+ await userEvent.click(buttonRef!)
+
+ await waitFor(() => {
+ expect(input).not.toHaveFocus()
})
})
})
diff --git a/packages/ui-form-field/src/FormField/__new-tests__/FormField.test.tsx b/packages/ui-form-field/src/FormField/__tests__/FormField.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormField/__new-tests__/FormField.test.tsx
rename to packages/ui-form-field/src/FormField/__tests__/FormField.test.tsx
diff --git a/packages/ui-form-field/src/FormFieldGroup/__new-tests__/FormFieldGroup.test.tsx b/packages/ui-form-field/src/FormFieldGroup/__tests__/FormFieldGroup.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormFieldGroup/__new-tests__/FormFieldGroup.test.tsx
rename to packages/ui-form-field/src/FormFieldGroup/__tests__/FormFieldGroup.test.tsx
diff --git a/packages/ui-form-field/src/FormFieldLabel/__new-tests__/FormFieldLabel.test.tsx b/packages/ui-form-field/src/FormFieldLabel/__tests__/FormFieldLabel.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormFieldLabel/__new-tests__/FormFieldLabel.test.tsx
rename to packages/ui-form-field/src/FormFieldLabel/__tests__/FormFieldLabel.test.tsx
diff --git a/packages/ui-form-field/src/FormFieldLayout/__new-tests__/FormFieldLayout.test.tsx b/packages/ui-form-field/src/FormFieldLayout/__tests__/FormFieldLayout.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormFieldLayout/__new-tests__/FormFieldLayout.test.tsx
rename to packages/ui-form-field/src/FormFieldLayout/__tests__/FormFieldLayout.test.tsx
diff --git a/packages/ui-form-field/src/FormFieldMessage/__new-tests__/FormFieldMessage.test.tsx b/packages/ui-form-field/src/FormFieldMessage/__tests__/FormFieldMessage.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormFieldMessage/__new-tests__/FormFieldMessage.test.tsx
rename to packages/ui-form-field/src/FormFieldMessage/__tests__/FormFieldMessage.test.tsx
diff --git a/packages/ui-form-field/src/FormFieldMessages/__new-tests__/FormFieldMessages.test.tsx b/packages/ui-form-field/src/FormFieldMessages/__tests__/FormFieldMessages.test.tsx
similarity index 100%
rename from packages/ui-form-field/src/FormFieldMessages/__new-tests__/FormFieldMessages.test.tsx
rename to packages/ui-form-field/src/FormFieldMessages/__tests__/FormFieldMessages.test.tsx
diff --git a/packages/ui-grid/src/Grid/__new-tests__/Grid.test.tsx b/packages/ui-grid/src/Grid/__tests__/Grid.test.tsx
similarity index 100%
rename from packages/ui-grid/src/Grid/__new-tests__/Grid.test.tsx
rename to packages/ui-grid/src/Grid/__tests__/Grid.test.tsx
diff --git a/packages/ui-grid/src/GridCol/__new-tests__/Grid.test.tsx b/packages/ui-grid/src/GridCol/__tests__/Grid.test.tsx
similarity index 100%
rename from packages/ui-grid/src/GridCol/__new-tests__/Grid.test.tsx
rename to packages/ui-grid/src/GridCol/__tests__/Grid.test.tsx
diff --git a/packages/ui-heading/src/Heading/__new-tests__/Heading.test.tsx b/packages/ui-heading/src/Heading/__tests__/Heading.test.tsx
similarity index 100%
rename from packages/ui-heading/src/Heading/__new-tests__/Heading.test.tsx
rename to packages/ui-heading/src/Heading/__tests__/Heading.test.tsx
diff --git a/packages/ui-i18n/src/ApplyLocale/__new-tests__/ApplyLocale.test.tsx b/packages/ui-i18n/src/ApplyLocale/__tests__/ApplyLocale.test.tsx
similarity index 100%
rename from packages/ui-i18n/src/ApplyLocale/__new-tests__/ApplyLocale.test.tsx
rename to packages/ui-i18n/src/ApplyLocale/__tests__/ApplyLocale.test.tsx
diff --git a/packages/ui-i18n/src/__new-tests__/DateTime.test.tsx b/packages/ui-i18n/src/__tests__/DateTime.test.tsx
similarity index 100%
rename from packages/ui-i18n/src/__new-tests__/DateTime.test.tsx
rename to packages/ui-i18n/src/__tests__/DateTime.test.tsx
diff --git a/packages/ui-i18n/src/__new-tests__/I18nPropTypes.test.tsx b/packages/ui-i18n/src/__tests__/I18nPropTypes.test.tsx
similarity index 100%
rename from packages/ui-i18n/src/__new-tests__/I18nPropTypes.test.tsx
rename to packages/ui-i18n/src/__tests__/I18nPropTypes.test.tsx
diff --git a/packages/ui-i18n/src/__new-tests__/Locale.test.tsx b/packages/ui-i18n/src/__tests__/Locale.test.tsx
similarity index 100%
rename from packages/ui-i18n/src/__new-tests__/Locale.test.tsx
rename to packages/ui-i18n/src/__tests__/Locale.test.tsx
diff --git a/packages/ui-i18n/src/__new-tests__/textDirectionContextConsumer.test.tsx b/packages/ui-i18n/src/__tests__/textDirectionContextConsumer.test.tsx
similarity index 100%
rename from packages/ui-i18n/src/__new-tests__/textDirectionContextConsumer.test.tsx
rename to packages/ui-i18n/src/__tests__/textDirectionContextConsumer.test.tsx
diff --git a/packages/ui-img/src/Img/__new-tests__/Img.test.tsx b/packages/ui-img/src/Img/__tests__/Img.test.tsx
similarity index 100%
rename from packages/ui-img/src/Img/__new-tests__/Img.test.tsx
rename to packages/ui-img/src/Img/__tests__/Img.test.tsx
diff --git a/packages/ui-link/src/Link/__new-tests__/Link.test.tsx b/packages/ui-link/src/Link/__tests__/Link.test.tsx
similarity index 100%
rename from packages/ui-link/src/Link/__new-tests__/Link.test.tsx
rename to packages/ui-link/src/Link/__tests__/Link.test.tsx
diff --git a/packages/ui-list/src/InlineList/InlineListItem/__new-tests__/InlineListItem.test.tsx b/packages/ui-list/src/InlineList/InlineListItem/__tests__/InlineListItem.test.tsx
similarity index 100%
rename from packages/ui-list/src/InlineList/InlineListItem/__new-tests__/InlineListItem.test.tsx
rename to packages/ui-list/src/InlineList/InlineListItem/__tests__/InlineListItem.test.tsx
diff --git a/packages/ui-list/src/InlineList/__new-tests__/InlineList.test.tsx b/packages/ui-list/src/InlineList/__tests__/InlineList.test.tsx
similarity index 100%
rename from packages/ui-list/src/InlineList/__new-tests__/InlineList.test.tsx
rename to packages/ui-list/src/InlineList/__tests__/InlineList.test.tsx
diff --git a/packages/ui-list/src/List/ListItem/__new-tests__/ListItem.test.tsx b/packages/ui-list/src/List/ListItem/__tests__/ListItem.test.tsx
similarity index 100%
rename from packages/ui-list/src/List/ListItem/__new-tests__/ListItem.test.tsx
rename to packages/ui-list/src/List/ListItem/__tests__/ListItem.test.tsx
diff --git a/packages/ui-list/src/List/__new-tests__/List.test.tsx b/packages/ui-list/src/List/__tests__/List.test.tsx
similarity index 100%
rename from packages/ui-list/src/List/__new-tests__/List.test.tsx
rename to packages/ui-list/src/List/__tests__/List.test.tsx
diff --git a/packages/ui-menu/src/Menu/MenuItem/__new-tests__/MenuItem.test.tsx b/packages/ui-menu/src/Menu/MenuItem/__tests__/MenuItem.test.tsx
similarity index 100%
rename from packages/ui-menu/src/Menu/MenuItem/__new-tests__/MenuItem.test.tsx
rename to packages/ui-menu/src/Menu/MenuItem/__tests__/MenuItem.test.tsx
diff --git a/packages/ui-menu/src/Menu/MenuItem/__tests__/theme.test.ts b/packages/ui-menu/src/Menu/MenuItem/__tests__/theme.test.ts
deleted file mode 100644
index 66942a6b76..0000000000
--- a/packages/ui-menu/src/Menu/MenuItem/__tests__/theme.test.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('MenuItem.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should ensure label color and icon color meet 3:1 contrast with background', () => {
- expect(contrast(variables.background, variables.labelColor)).to.be.above(
- 3
- )
- expect(contrast(variables.background, variables.iconColor)).to.be.above(3)
- })
- it('should ensure label and icon active colors meet 3:1 contrast with active background', () => {
- expect(
- contrast(variables.activeBackground, variables.activeLabelColor)
- ).to.be.above(3)
- expect(
- contrast(variables.activeBackground, variables.activeIconColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should ensure label color and icon color meet 4.5:1 contrast with background', () => {
- expect(contrast(variables.background, variables.labelColor)).to.be.above(
- 4.5
- )
- expect(contrast(variables.background, variables.iconColor)).to.be.above(
- 4.5
- )
- })
- it('should ensure label and icon active colors meet 4.5:1 contrast with active background', () => {
- expect(
- contrast(variables.activeBackground, variables.activeLabelColor)
- ).to.be.above(4.5)
- expect(
- contrast(variables.activeBackground, variables.activeIconColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-menu/src/Menu/MenuItemGroup/__new-tests__/MenuItemGroup.test.tsx b/packages/ui-menu/src/Menu/MenuItemGroup/__tests__/MenuItemGroup.test.tsx
similarity index 100%
rename from packages/ui-menu/src/Menu/MenuItemGroup/__new-tests__/MenuItemGroup.test.tsx
rename to packages/ui-menu/src/Menu/MenuItemGroup/__tests__/MenuItemGroup.test.tsx
diff --git a/packages/ui-menu/src/Menu/MenuItemGroup/__tests__/theme.test.ts b/packages/ui-menu/src/Menu/MenuItemGroup/__tests__/theme.test.ts
deleted file mode 100644
index d644e69b3a..0000000000
--- a/packages/ui-menu/src/Menu/MenuItemGroup/__tests__/theme.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('MenuItemGroup.theme', () => {
- describe('with the canvas theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-menu/src/Menu/__new-tests__/Menu.test.tsx b/packages/ui-menu/src/Menu/__tests__/Menu.test.tsx
similarity index 100%
rename from packages/ui-menu/src/Menu/__new-tests__/Menu.test.tsx
rename to packages/ui-menu/src/Menu/__tests__/Menu.test.tsx
diff --git a/packages/ui-metric/src/Metric/__new-tests__/Metric.test.tsx b/packages/ui-metric/src/Metric/__tests__/Metric.test.tsx
similarity index 100%
rename from packages/ui-metric/src/Metric/__new-tests__/Metric.test.tsx
rename to packages/ui-metric/src/Metric/__tests__/Metric.test.tsx
diff --git a/packages/ui-metric/src/MetricGroup/__new-tests__/MetricGroup.test.tsx b/packages/ui-metric/src/MetricGroup/__tests__/MetricGroup.test.tsx
similarity index 100%
rename from packages/ui-metric/src/MetricGroup/__new-tests__/MetricGroup.test.tsx
rename to packages/ui-metric/src/MetricGroup/__tests__/MetricGroup.test.tsx
diff --git a/packages/ui-modal/src/Modal/ModalBody/__new-tests__/ModalBody.test.tsx b/packages/ui-modal/src/Modal/ModalBody/__tests__/ModalBody.test.tsx
similarity index 100%
rename from packages/ui-modal/src/Modal/ModalBody/__new-tests__/ModalBody.test.tsx
rename to packages/ui-modal/src/Modal/ModalBody/__tests__/ModalBody.test.tsx
diff --git a/packages/ui-modal/src/Modal/ModalFooter/__new-tests__/ModalFooter.test.tsx b/packages/ui-modal/src/Modal/ModalFooter/__tests__/ModalFooter.test.tsx
similarity index 100%
rename from packages/ui-modal/src/Modal/ModalFooter/__new-tests__/ModalFooter.test.tsx
rename to packages/ui-modal/src/Modal/ModalFooter/__tests__/ModalFooter.test.tsx
diff --git a/packages/ui-modal/src/Modal/ModalHeader/__new-tests__/ModalHeader.test.tsx b/packages/ui-modal/src/Modal/ModalHeader/__tests__/ModalHeader.test.tsx
similarity index 100%
rename from packages/ui-modal/src/Modal/ModalHeader/__new-tests__/ModalHeader.test.tsx
rename to packages/ui-modal/src/Modal/ModalHeader/__tests__/ModalHeader.test.tsx
diff --git a/packages/ui-modal/src/Modal/__new-tests__/Modal.test.tsx b/packages/ui-modal/src/Modal/__tests__/Modal.test.tsx
similarity index 100%
rename from packages/ui-modal/src/Modal/__new-tests__/Modal.test.tsx
rename to packages/ui-modal/src/Modal/__tests__/Modal.test.tsx
diff --git a/packages/ui-motion/src/Transition/__new-tests__/Transition.test.tsx b/packages/ui-motion/src/Transition/__tests__/Transition.test.tsx
similarity index 100%
rename from packages/ui-motion/src/Transition/__new-tests__/Transition.test.tsx
rename to packages/ui-motion/src/Transition/__tests__/Transition.test.tsx
diff --git a/packages/ui-navigation/src/AppNav/Item/__new-tests__/Item.test.tsx b/packages/ui-navigation/src/AppNav/Item/__tests__/Item.test.tsx
similarity index 100%
rename from packages/ui-navigation/src/AppNav/Item/__new-tests__/Item.test.tsx
rename to packages/ui-navigation/src/AppNav/Item/__tests__/Item.test.tsx
diff --git a/packages/ui-navigation/src/AppNav/Item/__tests__/theme.test.ts b/packages/ui-navigation/src/AppNav/Item/__tests__/theme.test.ts
deleted file mode 100644
index f36468f07c..0000000000
--- a/packages/ui-navigation/src/AppNav/Item/__tests__/theme.test.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { contrast } from '@instructure/ui-color-utils'
-import { expect } from '@instructure/ui-test-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('AppNav.Item.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text color that meets 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.textColor)
- ).to.be.above(3)
- })
-
- it('should have a background and selected item text color that meets 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.textColorSelected)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text color that meets 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.textColor)
- ).to.be.above(4.5)
- })
-
- it('should have a background and selected item text color that meets 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.textColorSelected)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-navigation/src/AppNav/__new-tests__/AppNav.test.tsx b/packages/ui-navigation/src/AppNav/__tests__/AppNav.test.tsx
similarity index 100%
rename from packages/ui-navigation/src/AppNav/__new-tests__/AppNav.test.tsx
rename to packages/ui-navigation/src/AppNav/__tests__/AppNav.test.tsx
diff --git a/packages/ui-number-input/src/NumberInput/__new-tests__/NumberInput.test.tsx b/packages/ui-number-input/src/NumberInput/__tests__/NumberInput.test.tsx
similarity index 100%
rename from packages/ui-number-input/src/NumberInput/__new-tests__/NumberInput.test.tsx
rename to packages/ui-number-input/src/NumberInput/__tests__/NumberInput.test.tsx
diff --git a/packages/ui-options/src/Options/Item/__new-tests__/Item.test.tsx b/packages/ui-options/src/Options/Item/__tests__/Item.test.tsx
similarity index 100%
rename from packages/ui-options/src/Options/Item/__new-tests__/Item.test.tsx
rename to packages/ui-options/src/Options/Item/__tests__/Item.test.tsx
diff --git a/packages/ui-options/src/Options/Item/__tests__/theme.test.ts b/packages/ui-options/src/Options/Item/__tests__/theme.test.ts
deleted file mode 100644
index 546eb11e09..0000000000
--- a/packages/ui-options/src/Options/Item/__tests__/theme.test.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { contrast } from '@instructure/ui-color-utils'
-import { expect } from '@instructure/ui-test-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Item.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have default background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(3)
- })
-
- it('should have default background and description text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.descriptionColor)
- ).to.be.above(3)
- })
-
- it('should have highlighted background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(
- variables.highlightedBackground,
- variables.highlightedLabelColor
- )
- ).to.be.above(3)
- })
-
- it('should have selected background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.selectedBackground, variables.selectedLabelColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have default background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(4.5)
- })
-
- it('should have default background and description text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.descriptionColor)
- ).to.be.above(4.5)
- })
-
- it('should have highlighted background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(
- variables.highlightedBackground,
- variables.highlightedLabelColor
- )
- ).to.be.above(4.5)
- })
-
- it('should have selected background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.selectedBackground, variables.selectedLabelColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-options/src/Options/__new-tests__/Options.test.tsx b/packages/ui-options/src/Options/__tests__/Options.test.tsx
similarity index 100%
rename from packages/ui-options/src/Options/__new-tests__/Options.test.tsx
rename to packages/ui-options/src/Options/__tests__/Options.test.tsx
diff --git a/packages/ui-options/src/Options/__tests__/theme.test.ts b/packages/ui-options/src/Options/__tests__/theme.test.ts
deleted file mode 100644
index 707d0a60f9..0000000000
--- a/packages/ui-options/src/Options/__tests__/theme.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { contrast } from '@instructure/ui-color-utils'
-import { expect } from '@instructure/ui-test-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Options.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.labelColor)).to.be.above(
- 3
- )
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.labelColor)).to.be.above(
- 4.5
- )
- })
- })
-})
diff --git a/packages/ui-overlays/src/Mask/__new-tests__/Mask.test.tsx b/packages/ui-overlays/src/Mask/__tests__/Mask.test.tsx
similarity index 100%
rename from packages/ui-overlays/src/Mask/__new-tests__/Mask.test.tsx
rename to packages/ui-overlays/src/Mask/__tests__/Mask.test.tsx
diff --git a/packages/ui-overlays/src/Overlay/__new-tests__/Overlay.test.tsx b/packages/ui-overlays/src/Overlay/__tests__/Overlay.test.tsx
similarity index 100%
rename from packages/ui-overlays/src/Overlay/__new-tests__/Overlay.test.tsx
rename to packages/ui-overlays/src/Overlay/__tests__/Overlay.test.tsx
diff --git a/packages/ui-pages/src/Pages/Page/__new-tests__/Page.test.tsx b/packages/ui-pages/src/Pages/Page/__tests__/Page.test.tsx
similarity index 100%
rename from packages/ui-pages/src/Pages/Page/__new-tests__/Page.test.tsx
rename to packages/ui-pages/src/Pages/Page/__tests__/Page.test.tsx
diff --git a/packages/ui-pages/src/Pages/__new-tests__/Pages.test.tsx b/packages/ui-pages/src/Pages/__tests__/Pages.test.tsx
similarity index 100%
rename from packages/ui-pages/src/Pages/__new-tests__/Pages.test.tsx
rename to packages/ui-pages/src/Pages/__tests__/Pages.test.tsx
diff --git a/packages/ui-pages/src/Pages/__tests__/theme.test.ts b/packages/ui-pages/src/Pages/__tests__/theme.test.ts
deleted file mode 100644
index ded7565cd3..0000000000
--- a/packages/ui-pages/src/Pages/__tests__/theme.test.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-import generateComponentTheme from '../theme'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-describe('Pages.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-pagination/src/Pagination/PaginationArrowButton/__new-tests__/PaginationArrowButton.test.tsx b/packages/ui-pagination/src/Pagination/PaginationArrowButton/__tests__/PaginationArrowButton.test.tsx
similarity index 100%
rename from packages/ui-pagination/src/Pagination/PaginationArrowButton/__new-tests__/PaginationArrowButton.test.tsx
rename to packages/ui-pagination/src/Pagination/PaginationArrowButton/__tests__/PaginationArrowButton.test.tsx
diff --git a/packages/ui-pagination/src/Pagination/PaginationButton/__new-tests__/PaginationButton.test.tsx b/packages/ui-pagination/src/Pagination/PaginationButton/__tests__/PaginationButton.test.tsx
similarity index 100%
rename from packages/ui-pagination/src/Pagination/PaginationButton/__new-tests__/PaginationButton.test.tsx
rename to packages/ui-pagination/src/Pagination/PaginationButton/__tests__/PaginationButton.test.tsx
diff --git a/packages/ui-pagination/src/Pagination/PaginationPageInput/__new-tests__/PaginationPageInput.test.tsx b/packages/ui-pagination/src/Pagination/PaginationPageInput/__tests__/PaginationPageInput.test.tsx
similarity index 100%
rename from packages/ui-pagination/src/Pagination/PaginationPageInput/__new-tests__/PaginationPageInput.test.tsx
rename to packages/ui-pagination/src/Pagination/PaginationPageInput/__tests__/PaginationPageInput.test.tsx
diff --git a/packages/ui-pagination/src/Pagination/__new-tests__/Pagination.test.tsx b/packages/ui-pagination/src/Pagination/__tests__/Pagination.test.tsx
similarity index 100%
rename from packages/ui-pagination/src/Pagination/__new-tests__/Pagination.test.tsx
rename to packages/ui-pagination/src/Pagination/__tests__/Pagination.test.tsx
diff --git a/packages/ui-pill/package.json b/packages/ui-pill/package.json
index 8a1940aaf0..7d38bbc08d 100644
--- a/packages/ui-pill/package.json
+++ b/packages/ui-pill/package.json
@@ -41,8 +41,6 @@
"@instructure/ui-color-utils": "10.19.1",
"@instructure/ui-icons": "10.19.1",
"@instructure/ui-scripts": "10.19.1",
- "@instructure/ui-test-locator": "10.19.1",
- "@instructure/ui-test-queries": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@instructure/ui-themes": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
diff --git a/packages/ui-pill/src/Pill/PillLocator.ts b/packages/ui-pill/src/Pill/PillLocator.ts
deleted file mode 100644
index 556f0ccba8..0000000000
--- a/packages/ui-pill/src/Pill/PillLocator.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-import { parseQueryArguments } from '@instructure/ui-test-queries'
-// @ts-ignore: Cannot find module
-// eslint-disable-next-line no-restricted-imports
-import { TooltipLocator } from '@instructure/ui-tooltip/es/Tooltip/TooltipLocator'
-
-import { Pill } from './index'
-
-// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
-export const PillLocator = locator(Pill.selector, {
- findTooltipContent: async (...args: any[]) => {
- const { element, selector, options } = parseQueryArguments(...args)
- const tooltip = await TooltipLocator.find(element, options)
- return tooltip ? tooltip.findContent(selector, options) : null
- }
-})
diff --git a/packages/ui-pill/src/Pill/__new-tests__/Pill.test.tsx b/packages/ui-pill/src/Pill/__tests__/Pill.test.tsx
similarity index 100%
rename from packages/ui-pill/src/Pill/__new-tests__/Pill.test.tsx
rename to packages/ui-pill/src/Pill/__tests__/Pill.test.tsx
diff --git a/packages/ui-pill/src/Pill/__tests__/theme.test.ts b/packages/ui-pill/src/Pill/__tests__/theme.test.ts
deleted file mode 100644
index 2b0763c935..0000000000
--- a/packages/ui-pill/src/Pill/__tests__/theme.test.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Pill.theme', () => {
- describe('with the canvas theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.primaryColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.infoColor)).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.dangerColor)).to.be.above(
- 3
- )
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.successColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.warningColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.alertColor)).to.be.above(
- 3
- )
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.background, variables.primaryColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.infoColor)).to.be.above(
- 4.5
- )
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.dangerColor)).to.be.above(
- 3
- )
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.background, variables.successColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.background, variables.warningColor)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.alertColor)).to.be.above(
- 3
- )
- })
- })
-})
diff --git a/packages/ui-pill/src/Pill/locator.ts b/packages/ui-pill/src/Pill/locator.ts
deleted file mode 100644
index 1b034c0752..0000000000
--- a/packages/ui-pill/src/Pill/locator.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { PillLocator } from './PillLocator'
-
-export { PillLocator }
-export default PillLocator
diff --git a/packages/ui-pill/tsconfig.build.json b/packages/ui-pill/tsconfig.build.json
index 6f9eb69f8f..fb18ebd4d3 100644
--- a/packages/ui-pill/tsconfig.build.json
+++ b/packages/ui-pill/tsconfig.build.json
@@ -18,8 +18,6 @@
{ "path": "../ui-view/tsconfig.build.json" },
{ "path": "../ui-babel-preset/tsconfig.build.json" },
{ "path": "../ui-color-utils/tsconfig.build.json" },
- { "path": "../ui-test-locator/tsconfig.build.json" },
- { "path": "../ui-test-queries/tsconfig.build.json" },
{ "path": "../ui-test-utils/tsconfig.build.json" },
{ "path": "../ui-axe-check/tsconfig.build.json" },
{ "path": "../ui-scripts/tsconfig.build.json" },
diff --git a/packages/ui-popover/package.json b/packages/ui-popover/package.json
index 1949ed5d90..765c24be5a 100644
--- a/packages/ui-popover/package.json
+++ b/packages/ui-popover/package.json
@@ -44,8 +44,6 @@
"devDependencies": {
"@instructure/ui-babel-preset": "10.19.1",
"@instructure/ui-color-utils": "10.19.1",
- "@instructure/ui-test-locator": "10.19.1",
- "@instructure/ui-test-queries": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
diff --git a/packages/ui-popover/src/Popover/PopoverLocator.ts b/packages/ui-popover/src/Popover/PopoverLocator.ts
deleted file mode 100644
index 2c7e1d7910..0000000000
--- a/packages/ui-popover/src/Popover/PopoverLocator.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-// @ts-ignore: Cannot find module
-// eslint-disable-next-line no-restricted-imports
-import { PositionLocator } from '@instructure/ui-position/es/Position/PositionLocator'
-
-import { Popover } from './index'
-import { PopoverTriggerLocator } from './PopoverTriggerLocator'
-
-export const customMethods = {
- findContent: (...args: any[]) => PositionLocator.findContent(...args),
- findPositionTarget: (...args: any[]) => PositionLocator.findTarget(...args),
- findTrigger: (...args: any[]) => PopoverTriggerLocator.find(...args)
-}
-
-export { PopoverTriggerLocator }
-// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
-export const PopoverLocator = locator(Popover.selector, customMethods)
diff --git a/packages/ui-popover/src/Popover/PopoverTriggerLocator.ts b/packages/ui-popover/src/Popover/PopoverTriggerLocator.ts
deleted file mode 100644
index 010c1443d4..0000000000
--- a/packages/ui-popover/src/Popover/PopoverTriggerLocator.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-
-export const PopoverTriggerLocator = locator('[data-popover-trigger]')
diff --git a/packages/ui-popover/src/Popover/__new-tests__/Popover.test.tsx b/packages/ui-popover/src/Popover/__tests__/Popover.test.tsx
similarity index 100%
rename from packages/ui-popover/src/Popover/__new-tests__/Popover.test.tsx
rename to packages/ui-popover/src/Popover/__tests__/Popover.test.tsx
diff --git a/packages/ui-popover/src/Popover/locator.ts b/packages/ui-popover/src/Popover/locator.ts
deleted file mode 100644
index 3ae708a71c..0000000000
--- a/packages/ui-popover/src/Popover/locator.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { PopoverLocator } from './PopoverLocator'
-
-export { PopoverTriggerLocator, customMethods } from './PopoverLocator'
-export { PopoverLocator }
-export default PopoverLocator
diff --git a/packages/ui-popover/tsconfig.build.json b/packages/ui-popover/tsconfig.build.json
index ed305ce490..a6135cc8af 100644
--- a/packages/ui-popover/tsconfig.build.json
+++ b/packages/ui-popover/tsconfig.build.json
@@ -23,8 +23,6 @@
{ "path": "../uid/tsconfig.build.json" },
{ "path": "../ui-babel-preset/tsconfig.build.json" },
{ "path": "../ui-color-utils/tsconfig.build.json" },
- { "path": "../ui-test-locator/tsconfig.build.json" },
- { "path": "../ui-test-queries/tsconfig.build.json" },
{ "path": "../ui-test-utils/tsconfig.build.json" }
]
}
diff --git a/packages/ui-portal/src/Portal/__new-tests__/Portal.test.tsx b/packages/ui-portal/src/Portal/__tests__/Portal.test.tsx
similarity index 100%
rename from packages/ui-portal/src/Portal/__new-tests__/Portal.test.tsx
rename to packages/ui-portal/src/Portal/__tests__/Portal.test.tsx
diff --git a/packages/ui-position/package.json b/packages/ui-position/package.json
index cfe20d52fd..2c5d13011e 100644
--- a/packages/ui-position/package.json
+++ b/packages/ui-position/package.json
@@ -39,7 +39,6 @@
"devDependencies": {
"@instructure/ui-babel-preset": "10.19.1",
"@instructure/ui-color-utils": "10.19.1",
- "@instructure/ui-test-locator": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@instructure/ui-themes": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
diff --git a/packages/ui-position/src/Position/PositionContentLocator.ts b/packages/ui-position/src/Position/PositionContentLocator.ts
deleted file mode 100644
index 6d59d8951a..0000000000
--- a/packages/ui-position/src/Position/PositionContentLocator.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-import { Position } from './index'
-
-export const PositionContentLocator = locator(
- `[${Position.contentLocatorAttribute}]`
-)
diff --git a/packages/ui-position/src/Position/PositionLocator.ts b/packages/ui-position/src/Position/PositionLocator.ts
deleted file mode 100644
index c1b8fa1f5b..0000000000
--- a/packages/ui-position/src/Position/PositionLocator.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-import { locator } from '@instructure/ui-test-locator'
-import { Position } from './index'
-
-import { PositionContentLocator } from './PositionContentLocator'
-import { PositionTargetLocator } from './PositionTargetLocator'
-
-export const customMethods = {
- findTarget: (element: Element, ...args: any) => {
- if (element && element.getAttribute) {
- const id = element.getAttribute(Position.locatorAttribute)
- return locator(`[${Position.targetLocatorAttribute}="${id}"]`).find(
- ...args
- )
- }
- throw new Error('Element ' + element + ' not found')
- },
- findContent: (element: Element, ...args: any) => {
- if (element && element.getAttribute) {
- const id = element.getAttribute(Position.locatorAttribute)
- return locator(`[${Position.contentLocatorAttribute}="${id}"]`).find(
- ...args
- )
- }
- throw new Error('Element ' + element + ' not found')
- }
-}
-
-export { PositionContentLocator }
-export { PositionTargetLocator }
-
-// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
-export const PositionLocator = locator(Position.selector, customMethods)
diff --git a/packages/ui-position/src/Position/PositionTargetLocator.ts b/packages/ui-position/src/Position/PositionTargetLocator.ts
deleted file mode 100644
index 158b6d9467..0000000000
--- a/packages/ui-position/src/Position/PositionTargetLocator.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { Position } from './index'
-import { locator } from '@instructure/ui-test-locator'
-
-export const PositionTargetLocator = locator(
- `[${Position.targetLocatorAttribute}]`
-)
diff --git a/packages/ui-position/src/Position/__new-tests__/Position.test.tsx b/packages/ui-position/src/Position/__tests__/Position.test.tsx
similarity index 100%
rename from packages/ui-position/src/Position/__new-tests__/Position.test.tsx
rename to packages/ui-position/src/Position/__tests__/Position.test.tsx
diff --git a/packages/ui-position/src/Position/locator.ts b/packages/ui-position/src/Position/locator.ts
deleted file mode 100644
index c550dff4f6..0000000000
--- a/packages/ui-position/src/Position/locator.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { PositionLocator } from './PositionLocator'
-
-export {
- PositionContentLocator,
- PositionTargetLocator,
- customMethods
-} from './PositionLocator'
-
-export { PositionLocator }
-export default PositionLocator
diff --git a/packages/ui-position/src/__new-tests__/mirrorHorizontalPlacement.test.tsx b/packages/ui-position/src/__tests__/mirrorHorizontalPlacement.test.tsx
similarity index 100%
rename from packages/ui-position/src/__new-tests__/mirrorHorizontalPlacement.test.tsx
rename to packages/ui-position/src/__tests__/mirrorHorizontalPlacement.test.tsx
diff --git a/packages/ui-position/src/__new-tests__/mirrorPlacement.test.tsx b/packages/ui-position/src/__tests__/mirrorPlacement.test.tsx
similarity index 100%
rename from packages/ui-position/src/__new-tests__/mirrorPlacement.test.tsx
rename to packages/ui-position/src/__tests__/mirrorPlacement.test.tsx
diff --git a/packages/ui-position/tsconfig.build.json b/packages/ui-position/tsconfig.build.json
index 25d47a52fb..a2710743e0 100644
--- a/packages/ui-position/tsconfig.build.json
+++ b/packages/ui-position/tsconfig.build.json
@@ -43,9 +43,6 @@
{
"path": "../ui-color-utils/tsconfig.build.json"
},
- {
- "path": "../ui-test-locator/tsconfig.build.json"
- },
{
"path": "../ui-test-utils/tsconfig.build.json"
},
diff --git a/packages/ui-progress/src/ProgressBar/__new-tests__/ProgressBar.test.tsx b/packages/ui-progress/src/ProgressBar/__tests__/ProgressBar.test.tsx
similarity index 100%
rename from packages/ui-progress/src/ProgressBar/__new-tests__/ProgressBar.test.tsx
rename to packages/ui-progress/src/ProgressBar/__tests__/ProgressBar.test.tsx
diff --git a/packages/ui-progress/src/ProgressBar/__tests__/theme.test.ts b/packages/ui-progress/src/ProgressBar/__tests__/theme.test.ts
deleted file mode 100644
index 485b5c1f72..0000000000
--- a/packages/ui-progress/src/ProgressBar/__tests__/theme.test.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('ProgressBar.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should ensure brand meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorBrand, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure info meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorInfo, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure success meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorSuccess, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure danger meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorDanger, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure warning meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorWarning, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure alert meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorAlert, variables.trackColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
- it('should ensure brand meter color and track color meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.meterColorBrand, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure info meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorInfo, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure success meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorSuccess, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure danger meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorDanger, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure warning meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorWarning, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure alert meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorAlert, variables.trackColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-progress/src/ProgressCircle/__new-tests__/ProgressCircle.test.tsx b/packages/ui-progress/src/ProgressCircle/__tests__/ProgressCircle.test.tsx
similarity index 100%
rename from packages/ui-progress/src/ProgressCircle/__new-tests__/ProgressCircle.test.tsx
rename to packages/ui-progress/src/ProgressCircle/__tests__/ProgressCircle.test.tsx
diff --git a/packages/ui-progress/src/ProgressCircle/__tests__/theme.test.ts b/packages/ui-progress/src/ProgressCircle/__tests__/theme.test.ts
deleted file mode 100644
index 5b1a19bbcc..0000000000
--- a/packages/ui-progress/src/ProgressCircle/__tests__/theme.test.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('ProgressCircle.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- describe('default', () => {
- it('should ensure brand meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorBrand, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure info meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorInfo, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure success meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorSuccess, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure danger meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorDanger, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure warning meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorWarning, variables.trackColor)
- ).to.be.above(3)
- })
- it('should ensure alert meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorAlert, variables.trackColor)
- ).to.be.above(3)
- })
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('default', () => {
- it('should ensure brand meter color and track color meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.meterColorBrand, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure info meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorInfo, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure success meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorSuccess, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure danger meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorDanger, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure warning meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorWarning, variables.trackColor)
- ).to.be.above(4.5)
- })
- it('should ensure alert meter color and track color meet 3:1 contrast', () => {
- expect(
- contrast(variables.meterColorAlert, variables.trackColor)
- ).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-prop-types/src/__new-tests__/children.test.tsx b/packages/ui-prop-types/src/__tests__/children.test.tsx
similarity index 100%
rename from packages/ui-prop-types/src/__new-tests__/children.test.tsx
rename to packages/ui-prop-types/src/__tests__/children.test.tsx
diff --git a/packages/ui-prop-types/src/__new-tests__/childrenOrValue.test.tsx b/packages/ui-prop-types/src/__tests__/childrenOrValue.test.tsx
similarity index 100%
rename from packages/ui-prop-types/src/__new-tests__/childrenOrValue.test.tsx
rename to packages/ui-prop-types/src/__tests__/childrenOrValue.test.tsx
diff --git a/packages/ui-prop-types/src/__new-tests__/controllable.test.tsx b/packages/ui-prop-types/src/__tests__/controllable.test.tsx
similarity index 100%
rename from packages/ui-prop-types/src/__new-tests__/controllable.test.tsx
rename to packages/ui-prop-types/src/__tests__/controllable.test.tsx
diff --git a/packages/ui-prop-types/src/__new-tests__/makeRequirable.test.tsx b/packages/ui-prop-types/src/__tests__/makeRequirable.test.tsx
similarity index 100%
rename from packages/ui-prop-types/src/__new-tests__/makeRequirable.test.tsx
rename to packages/ui-prop-types/src/__tests__/makeRequirable.test.tsx
diff --git a/packages/ui-prop-types/src/__new-tests__/xor.test.tsx b/packages/ui-prop-types/src/__tests__/xor.test.tsx
similarity index 100%
rename from packages/ui-prop-types/src/__new-tests__/xor.test.tsx
rename to packages/ui-prop-types/src/__tests__/xor.test.tsx
diff --git a/packages/ui-radio-input/src/RadioInput/__new-tests__/RadioInput.test.tsx b/packages/ui-radio-input/src/RadioInput/__tests__/RadioInput.test.tsx
similarity index 100%
rename from packages/ui-radio-input/src/RadioInput/__new-tests__/RadioInput.test.tsx
rename to packages/ui-radio-input/src/RadioInput/__tests__/RadioInput.test.tsx
diff --git a/packages/ui-radio-input/src/RadioInput/__tests__/theme.test.ts b/packages/ui-radio-input/src/RadioInput/__tests__/theme.test.ts
deleted file mode 100644
index 2572d100ed..0000000000
--- a/packages/ui-radio-input/src/RadioInput/__tests__/theme.test.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('RadioInput.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should ensure toggle text meets 3:1 contrast with success-state background', () => {
- expect(
- contrast(variables.toggleBackgroundSuccess, variables.toggleHandleText)
- ).to.be.above(3)
- })
- it('should ensure toggle text meets 3:1 contrast with off-state background', () => {
- expect(
- contrast(variables.toggleBackgroundOff, variables.toggleHandleText)
- ).to.be.above(3)
- })
- it('should ensure toggle text meets 3:1 contrast with warning-state background', () => {
- expect(
- contrast(variables.toggleBackgroundWarning, variables.toggleHandleText)
- ).to.be.above(3)
- })
- it('should ensure toggle text meets 3:1 contrast with danger-state background', () => {
- expect(
- contrast(variables.toggleBackgroundDanger, variables.toggleHandleText)
- ).to.be.above(3)
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should ensure toggle text meets 4.5:1 contrast with success-state background', () => {
- expect(
- contrast(variables.toggleBackgroundSuccess, variables.toggleHandleText)
- ).to.be.above(4.5)
- })
- it('should ensure toggle text meets 4.5:1 contrast with off-state background', () => {
- expect(
- contrast(variables.toggleBackgroundOff, variables.toggleHandleText)
- ).to.be.above(4.5)
- })
- it('should ensure toggle text meets 4.5:1 contrast with warning-state background', () => {
- expect(
- contrast(variables.toggleBackgroundWarning, variables.toggleHandleText)
- ).to.be.above(4.5)
- })
- it('should ensure toggle text meets 4.5:1 contrast with danger-state background', () => {
- expect(
- contrast(variables.toggleBackgroundDanger, variables.toggleHandleText)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-radio-input/src/RadioInputGroup/__new-tests__/RadioInputGroup.test.tsx b/packages/ui-radio-input/src/RadioInputGroup/__tests__/RadioInputGroup.test.tsx
similarity index 100%
rename from packages/ui-radio-input/src/RadioInputGroup/__new-tests__/RadioInputGroup.test.tsx
rename to packages/ui-radio-input/src/RadioInputGroup/__tests__/RadioInputGroup.test.tsx
diff --git a/packages/ui-range-input/src/RangeInput/__new-tests__/RangeInput.test.tsx b/packages/ui-range-input/src/RangeInput/__tests__/RangeInput.test.tsx
similarity index 100%
rename from packages/ui-range-input/src/RangeInput/__new-tests__/RangeInput.test.tsx
rename to packages/ui-range-input/src/RangeInput/__tests__/RangeInput.test.tsx
diff --git a/packages/ui-rating/src/Rating/__new-tests__/Rating.test.tsx b/packages/ui-rating/src/Rating/__tests__/Rating.test.tsx
similarity index 100%
rename from packages/ui-rating/src/Rating/__new-tests__/Rating.test.tsx
rename to packages/ui-rating/src/Rating/__tests__/Rating.test.tsx
diff --git a/packages/ui-rating/src/RatingIcon/__new-tests__/RatingIcon.test.tsx b/packages/ui-rating/src/RatingIcon/__tests__/RatingIcon.test.tsx
similarity index 100%
rename from packages/ui-rating/src/RatingIcon/__new-tests__/RatingIcon.test.tsx
rename to packages/ui-rating/src/RatingIcon/__tests__/RatingIcon.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/DeterministicIdContext.test.tsx b/packages/ui-react-utils/src/__tests__/DeterministicIdContext.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/DeterministicIdContext.test.tsx
rename to packages/ui-react-utils/src/__tests__/DeterministicIdContext.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/callRenderProp.test.tsx b/packages/ui-react-utils/src/__tests__/callRenderProp.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/callRenderProp.test.tsx
rename to packages/ui-react-utils/src/__tests__/callRenderProp.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/deprecated.test.tsx b/packages/ui-react-utils/src/__tests__/deprecated.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/deprecated.test.tsx
rename to packages/ui-react-utils/src/__tests__/deprecated.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/experimental.test.tsx b/packages/ui-react-utils/src/__tests__/experimental.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/experimental.test.tsx
rename to packages/ui-react-utils/src/__tests__/experimental.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/getInteraction.test.tsx b/packages/ui-react-utils/src/__tests__/getInteraction.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/getInteraction.test.tsx
rename to packages/ui-react-utils/src/__tests__/getInteraction.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/hack.test.tsx b/packages/ui-react-utils/src/__tests__/hack.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/hack.test.tsx
rename to packages/ui-react-utils/src/__tests__/hack.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/omitProps.test.tsx b/packages/ui-react-utils/src/__tests__/omitProps.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/omitProps.test.tsx
rename to packages/ui-react-utils/src/__tests__/omitProps.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/passthroughProps.test.tsx b/packages/ui-react-utils/src/__tests__/passthroughProps.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/passthroughProps.test.tsx
rename to packages/ui-react-utils/src/__tests__/passthroughProps.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/pickProps.test.tsx b/packages/ui-react-utils/src/__tests__/pickProps.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/pickProps.test.tsx
rename to packages/ui-react-utils/src/__tests__/pickProps.test.tsx
diff --git a/packages/ui-react-utils/src/__new-tests__/safeCloneElement.test.tsx b/packages/ui-react-utils/src/__tests__/safeCloneElement.test.tsx
similarity index 100%
rename from packages/ui-react-utils/src/__new-tests__/safeCloneElement.test.tsx
rename to packages/ui-react-utils/src/__tests__/safeCloneElement.test.tsx
diff --git a/packages/ui-responsive/src/Responsive/__new-tests__/Responsive.test.tsx b/packages/ui-responsive/src/Responsive/__tests__/Responsive.test.tsx
similarity index 100%
rename from packages/ui-responsive/src/Responsive/__new-tests__/Responsive.test.tsx
rename to packages/ui-responsive/src/Responsive/__tests__/Responsive.test.tsx
diff --git a/packages/ui-select/src/Select/__new-tests__/Select.test.tsx b/packages/ui-select/src/Select/__tests__/Select.test.tsx
similarity index 100%
rename from packages/ui-select/src/Select/__new-tests__/Select.test.tsx
rename to packages/ui-select/src/Select/__tests__/Select.test.tsx
diff --git a/packages/ui-select/src/Select/__tests__/theme.test.ts b/packages/ui-select/src/Select/__tests__/theme.test.ts
deleted file mode 100644
index ea6db987d4..0000000000
--- a/packages/ui-select/src/Select/__tests__/theme.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Select.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-selectable/src/Selectable/__new-tests__/Selectable.test.tsx b/packages/ui-selectable/src/Selectable/__tests__/Selectable.test.tsx
similarity index 100%
rename from packages/ui-selectable/src/Selectable/__new-tests__/Selectable.test.tsx
rename to packages/ui-selectable/src/Selectable/__tests__/Selectable.test.tsx
diff --git a/packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__new-tests__/NavigationItem.test.tsx b/packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__tests__/NavigationItem.test.tsx
similarity index 100%
rename from packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__new-tests__/NavigationItem.test.tsx
rename to packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__tests__/NavigationItem.test.tsx
diff --git a/packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__tests__/theme.test.ts b/packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__tests__/theme.test.ts
deleted file mode 100644
index fc7e567c3b..0000000000
--- a/packages/ui-side-nav-bar/src/SideNavBar/SideNavBarItem/__tests__/theme.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { contrast } from '@instructure/ui-color-utils'
-import { expect } from '@instructure/ui-test-utils'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-import generateComponentTheme from '../theme'
-
-describe('SideNavBarItem.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.fontColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.fontColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-side-nav-bar/src/SideNavBar/__new-tests__/SideNavBar.test.tsx b/packages/ui-side-nav-bar/src/SideNavBar/__tests__/SideNavBar.test.tsx
similarity index 100%
rename from packages/ui-side-nav-bar/src/SideNavBar/__new-tests__/SideNavBar.test.tsx
rename to packages/ui-side-nav-bar/src/SideNavBar/__tests__/SideNavBar.test.tsx
diff --git a/packages/ui-side-nav-bar/src/SideNavBar/__tests__/theme.test.ts b/packages/ui-side-nav-bar/src/SideNavBar/__tests__/theme.test.ts
deleted file mode 100644
index 809de5fc6d..0000000000
--- a/packages/ui-side-nav-bar/src/SideNavBar/__tests__/theme.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { contrast } from '@instructure/ui-color-utils'
-import { expect } from '@instructure/ui-test-utils'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-import generateComponentTheme from '../theme'
-
-describe('SideNavBar.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.fontColor)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundColor, variables.fontColor)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-simple-select/src/SimpleSelect/__new-tests__/SimpleSelect.test.tsx b/packages/ui-simple-select/src/SimpleSelect/__tests__/SimpleSelect.test.tsx
similarity index 100%
rename from packages/ui-simple-select/src/SimpleSelect/__new-tests__/SimpleSelect.test.tsx
rename to packages/ui-simple-select/src/SimpleSelect/__tests__/SimpleSelect.test.tsx
diff --git a/packages/ui-source-code-editor/src/SourceCodeEditor/__new-tests__/SourceCodeEditor.test.tsx b/packages/ui-source-code-editor/src/SourceCodeEditor/__tests__/SourceCodeEditor.test.tsx
similarity index 100%
rename from packages/ui-source-code-editor/src/SourceCodeEditor/__new-tests__/SourceCodeEditor.test.tsx
rename to packages/ui-source-code-editor/src/SourceCodeEditor/__tests__/SourceCodeEditor.test.tsx
diff --git a/packages/ui-spinner/src/Spinner/__new-tests__/Spinner.test.tsx b/packages/ui-spinner/src/Spinner/__tests__/Spinner.test.tsx
similarity index 100%
rename from packages/ui-spinner/src/Spinner/__new-tests__/Spinner.test.tsx
rename to packages/ui-spinner/src/Spinner/__tests__/Spinner.test.tsx
diff --git a/packages/ui-spinner/src/Spinner/__tests__/theme.test.ts b/packages/ui-spinner/src/Spinner/__tests__/theme.test.ts
deleted file mode 100644
index 7affdd1ae5..0000000000
--- a/packages/ui-spinner/src/Spinner/__tests__/theme.test.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Spinner.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- describe('default', () => {
- it('should ensure meter color and track color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.trackColor)).to.be.above(3)
- })
- })
-
- describe('inverse', () => {
- it('should ensure meter color and track color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.trackColor)).to.be.above(3)
- })
- })
- })
-
- describe('with the "canvas-high-contrast" theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('default', () => {
- it('should ensure meter color and track color meet 4.5:1 contrast', () => {
- expect(contrast(variables.color, variables.trackColor)).to.be.above(4.5)
- })
- })
-
- describe('inverse', () => {
- it('should ensure meter color and track color meet 4.5:1 contrast', () => {
- expect(contrast(variables.color, variables.trackColor)).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-svg-images/src/InlineSVG/__new-tests__/InlineSVG.test.tsx b/packages/ui-svg-images/src/InlineSVG/__tests__/InlineSVG.test.tsx
similarity index 100%
rename from packages/ui-svg-images/src/InlineSVG/__new-tests__/InlineSVG.test.tsx
rename to packages/ui-svg-images/src/InlineSVG/__tests__/InlineSVG.test.tsx
diff --git a/packages/ui-svg-images/src/SVGIcon/__new-tests__/SVGIcon.test.tsx b/packages/ui-svg-images/src/SVGIcon/__tests__/SVGIcon.test.tsx
similarity index 100%
rename from packages/ui-svg-images/src/SVGIcon/__new-tests__/SVGIcon.test.tsx
rename to packages/ui-svg-images/src/SVGIcon/__tests__/SVGIcon.test.tsx
diff --git a/packages/ui-table/src/Table/__new-tests__/Table.test.tsx b/packages/ui-table/src/Table/__tests__/Table.test.tsx
similarity index 100%
rename from packages/ui-table/src/Table/__new-tests__/Table.test.tsx
rename to packages/ui-table/src/Table/__tests__/Table.test.tsx
diff --git a/packages/ui-table/src/Table/__tests__/theme.test.ts b/packages/ui-table/src/Table/__tests__/theme.test.ts
deleted file mode 100644
index 9406925f1f..0000000000
--- a/packages/ui-table/src/Table/__tests__/theme.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Table.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(contrast(variables.background, variables.color)).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/ui-tabs/src/Tabs/Panel/__new-tests__/Panel.test.tsx b/packages/ui-tabs/src/Tabs/Panel/__tests__/Panel.test.tsx
similarity index 100%
rename from packages/ui-tabs/src/Tabs/Panel/__new-tests__/Panel.test.tsx
rename to packages/ui-tabs/src/Tabs/Panel/__tests__/Panel.test.tsx
diff --git a/packages/ui-tabs/src/Tabs/Panel/__tests__/theme.test.ts b/packages/ui-tabs/src/Tabs/Panel/__tests__/theme.test.ts
deleted file mode 100644
index dd32a91be7..0000000000
--- a/packages/ui-tabs/src/Tabs/Panel/__tests__/theme.test.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Panel.theme', async () => {
- describe('with the default theme', async () => {
- const variables = generateComponentTheme(canvas)
-
- describe('secondary variant', async () => {
- it('should ensure text and tab panel background meet 3:1 contrast', async () => {
- expect(contrast(variables.color, variables.background)).to.be.above(3)
- })
- })
- })
-
- describe('with the "canvas-high-contrast" theme', async () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('secondary variant', async () => {
- it('should ensure text and tab panel background meet 4.5:1 contrast', async () => {
- expect(contrast(variables.color, variables.background)).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-tabs/src/Tabs/Tab/__new-tests__/Tab.test.tsx b/packages/ui-tabs/src/Tabs/Tab/__tests__/Tab.test.tsx
similarity index 100%
rename from packages/ui-tabs/src/Tabs/Tab/__new-tests__/Tab.test.tsx
rename to packages/ui-tabs/src/Tabs/Tab/__tests__/Tab.test.tsx
diff --git a/packages/ui-tabs/src/Tabs/Tab/__tests__/theme.test.ts b/packages/ui-tabs/src/Tabs/Tab/__tests__/theme.test.ts
deleted file mode 100644
index 24e7e073ce..0000000000
--- a/packages/ui-tabs/src/Tabs/Tab/__tests__/theme.test.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-import generateComponentTheme from '../theme'
-
-describe('Tab.theme', async () => {
- describe('with the default theme', async () => {
- const variables = generateComponentTheme(canvas)
-
- describe('secondary variant', async () => {
- it('should ensure text and tab background meet 3:1 contrast', async () => {
- expect(
- contrast(
- variables.secondaryColor,
- variables.secondarySelectedBackground
- )
- ).to.be.above(3)
- })
- })
- })
-
- describe('with the "canvas-high-contrast" theme', async () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('secondary variant', async () => {
- it('should ensure text and tab background meet 4.5:1 contrast', async () => {
- expect(
- contrast(
- variables.secondaryColor,
- variables.secondarySelectedBackground
- )
- ).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-tabs/src/Tabs/__new-tests__/Tabs.test.tsx b/packages/ui-tabs/src/Tabs/__tests__/Tabs.test.tsx
similarity index 100%
rename from packages/ui-tabs/src/Tabs/__new-tests__/Tabs.test.tsx
rename to packages/ui-tabs/src/Tabs/__tests__/Tabs.test.tsx
diff --git a/packages/ui-tag/src/Tag/__new-tests__/Tag.test.tsx b/packages/ui-tag/src/Tag/__tests__/Tag.test.tsx
similarity index 100%
rename from packages/ui-tag/src/Tag/__new-tests__/Tag.test.tsx
rename to packages/ui-tag/src/Tag/__tests__/Tag.test.tsx
diff --git a/packages/ui-tag/src/Tag/__tests__/theme.test.ts b/packages/ui-tag/src/Tag/__tests__/theme.test.ts
deleted file mode 100644
index d41188072d..0000000000
--- a/packages/ui-tag/src/Tag/__tests__/theme.test.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-
-import generateComponentTheme from '../theme'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-type Background = 'defaultBackground' | 'inlineBackground'
-type TextColor = 'defaultColor' | 'inlineColor'
-
-describe('Tag.theme', () => {
- const variants = ['default', 'inline'] as const
-
- context('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- variants.forEach((variant) => {
- context(`with the ${variant} variant`, () => {
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(
- variables[`${variant}Background` as Background],
- variables[`${variant}Color` as TextColor]
- )
- ).to.be.above(3)
- })
- })
- })
- })
-
- describe('with the accessible canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- variants.forEach((variant) => {
- context(`with the ${variant} variant`, () => {
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(
- variables[`${variant}Background` as Background],
- variables[`${variant}TextColor` as TextColor]
- )
- ).to.be.above(4.5)
- })
- })
- })
- })
-})
diff --git a/packages/ui-test-utils/src/__tests__/assertions.test.tsx b/packages/ui-test-utils/src/__old-tests__/assertions.test.tsx
similarity index 100%
rename from packages/ui-test-utils/src/__tests__/assertions.test.tsx
rename to packages/ui-test-utils/src/__old-tests__/assertions.test.tsx
diff --git a/packages/ui-test-utils/src/__tests__/generateComponentExamples.test.tsx b/packages/ui-test-utils/src/__old-tests__/generateComponentExamples.test.tsx
similarity index 99%
rename from packages/ui-test-utils/src/__tests__/generateComponentExamples.test.tsx
rename to packages/ui-test-utils/src/__old-tests__/generateComponentExamples.test.tsx
index 43f3b5e529..78497f08a1 100644
--- a/packages/ui-test-utils/src/__tests__/generateComponentExamples.test.tsx
+++ b/packages/ui-test-utils/src/__old-tests__/generateComponentExamples.test.tsx
@@ -22,7 +22,7 @@
* SOFTWARE.
*/
-import { Component } from 'react'
+import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { expect, StoryConfig } from '..'
diff --git a/packages/ui-test-utils/src/__tests__/generatePropCombinations.test.ts b/packages/ui-test-utils/src/__old-tests__/generatePropCombinations.test.ts
similarity index 100%
rename from packages/ui-test-utils/src/__tests__/generatePropCombinations.test.ts
rename to packages/ui-test-utils/src/__old-tests__/generatePropCombinations.test.ts
diff --git a/packages/ui-test-utils/src/__tests__/locator.test.tsx b/packages/ui-test-utils/src/__old-tests__/locator.test.tsx
similarity index 99%
rename from packages/ui-test-utils/src/__tests__/locator.test.tsx
rename to packages/ui-test-utils/src/__old-tests__/locator.test.tsx
index 36cc22b8d5..e3ac43f4fe 100644
--- a/packages/ui-test-utils/src/__tests__/locator.test.tsx
+++ b/packages/ui-test-utils/src/__old-tests__/locator.test.tsx
@@ -22,6 +22,8 @@
* SOFTWARE.
*/
+//TODO uncomment if needed
+/*
import { Component as ReactComponent } from 'react'
import PropTypes from 'prop-types'
@@ -114,3 +116,4 @@ describe('locator', async () => {
)
})
})
+*/
\ No newline at end of file
diff --git a/packages/ui-test-utils/src/__tests__/queries.test.tsx b/packages/ui-test-utils/src/__old-tests__/queries.test.tsx
similarity index 100%
rename from packages/ui-test-utils/src/__tests__/queries.test.tsx
rename to packages/ui-test-utils/src/__old-tests__/queries.test.tsx
diff --git a/packages/ui-test-utils/src/__tests__/reactComponentWrapper.test.tsx b/packages/ui-test-utils/src/__old-tests__/reactComponentWrapper.test.tsx
similarity index 100%
rename from packages/ui-test-utils/src/__tests__/reactComponentWrapper.test.tsx
rename to packages/ui-test-utils/src/__old-tests__/reactComponentWrapper.test.tsx
diff --git a/packages/ui-testable/src/__tests__/testable.test.tsx b/packages/ui-testable/src/__old-tests__/testable.test.tsx
similarity index 100%
rename from packages/ui-testable/src/__tests__/testable.test.tsx
rename to packages/ui-testable/src/__old-tests__/testable.test.tsx
diff --git a/packages/ui-text-area/src/TextArea/__new-tests__/TextArea.test.tsx b/packages/ui-text-area/src/TextArea/__tests__/TextArea.test.tsx
similarity index 100%
rename from packages/ui-text-area/src/TextArea/__new-tests__/TextArea.test.tsx
rename to packages/ui-text-area/src/TextArea/__tests__/TextArea.test.tsx
diff --git a/packages/ui-text-area/src/TextArea/__tests__/theme.test.ts b/packages/ui-text-area/src/TextArea/__tests__/theme.test.ts
deleted file mode 100644
index 409686011d..0000000000
--- a/packages/ui-text-area/src/TextArea/__tests__/theme.test.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-import generateComponentTheme from '../theme'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-describe('TextArea.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- describe('default', () => {
- it('should ensure focus color and background color meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.focusOutlineColor)
- ).to.be.above(3)
- })
-
- it('should ensure text color and background color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.background)).to.be.above(3)
- })
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('default', () => {
- it('should ensure focus color and background color meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.background, variables.focusOutlineColor)
- ).to.be.above(4.5)
- })
-
- it('should ensure text color and background color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.background)).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-text-input/src/TextInput/__new-tests__/TextInput.test.tsx b/packages/ui-text-input/src/TextInput/__tests__/TextInput.test.tsx
similarity index 100%
rename from packages/ui-text-input/src/TextInput/__new-tests__/TextInput.test.tsx
rename to packages/ui-text-input/src/TextInput/__tests__/TextInput.test.tsx
diff --git a/packages/ui-text-input/src/TextInput/__tests__/theme.test.ts b/packages/ui-text-input/src/TextInput/__tests__/theme.test.ts
deleted file mode 100644
index b65dbca328..0000000000
--- a/packages/ui-text-input/src/TextInput/__tests__/theme.test.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-import generateComponentTheme from '../theme'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-describe('TextInput.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- describe('default', () => {
- it('should ensure focus color and background color meet 3:1 contrast', () => {
- expect(
- contrast(variables.background, variables.focusOutlineColor)
- ).to.be.above(3)
- })
-
- it('should ensure text color and background color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.background)).to.be.above(3)
- })
- })
- })
-
- describe('with the high contrast canvas theme', () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- describe('default', () => {
- it('should ensure focus color and background color meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.background, variables.focusOutlineColor)
- ).to.be.above(4.5)
- })
-
- it('should ensure text color and background color meet 3:1 contrast', () => {
- expect(contrast(variables.color, variables.background)).to.be.above(4.5)
- })
- })
- })
-})
diff --git a/packages/ui-text/src/Text/__new-tests__/Text.test.tsx b/packages/ui-text/src/Text/__tests__/Text.test.tsx
similarity index 100%
rename from packages/ui-text/src/Text/__new-tests__/Text.test.tsx
rename to packages/ui-text/src/Text/__tests__/Text.test.tsx
diff --git a/packages/ui-themes/src/__new-tests__/themes.test.tsx b/packages/ui-themes/src/__tests__/themes.test.tsx
similarity index 100%
rename from packages/ui-themes/src/__new-tests__/themes.test.tsx
rename to packages/ui-themes/src/__tests__/themes.test.tsx
diff --git a/packages/ui-time-select/src/TimeSelect/__new-tests__/TimeSelect.test.tsx b/packages/ui-time-select/src/TimeSelect/__tests__/TimeSelect.test.tsx
similarity index 100%
rename from packages/ui-time-select/src/TimeSelect/__new-tests__/TimeSelect.test.tsx
rename to packages/ui-time-select/src/TimeSelect/__tests__/TimeSelect.test.tsx
diff --git a/packages/ui-toggle-details/src/ToggleDetails/__new-tests__/ToggleDetails.test.tsx b/packages/ui-toggle-details/src/ToggleDetails/__tests__/ToggleDetails.test.tsx
similarity index 100%
rename from packages/ui-toggle-details/src/ToggleDetails/__new-tests__/ToggleDetails.test.tsx
rename to packages/ui-toggle-details/src/ToggleDetails/__tests__/ToggleDetails.test.tsx
diff --git a/packages/ui-toggle-details/src/ToggleGroup/__new-tests__/ToggleGroup.test.tsx b/packages/ui-toggle-details/src/ToggleGroup/__tests__/ToggleGroup.test.tsx
similarity index 100%
rename from packages/ui-toggle-details/src/ToggleGroup/__new-tests__/ToggleGroup.test.tsx
rename to packages/ui-toggle-details/src/ToggleGroup/__tests__/ToggleGroup.test.tsx
diff --git a/packages/ui-tooltip/package.json b/packages/ui-tooltip/package.json
index d36d82c2aa..fba112a6e6 100644
--- a/packages/ui-tooltip/package.json
+++ b/packages/ui-tooltip/package.json
@@ -39,8 +39,6 @@
"@instructure/ui-babel-preset": "10.19.1",
"@instructure/ui-color-utils": "10.19.1",
"@instructure/ui-scripts": "10.19.1",
- "@instructure/ui-test-locator": "10.19.1",
- "@instructure/ui-test-queries": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@instructure/ui-themes": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
diff --git a/packages/ui-tooltip/src/Tooltip/TooltipLocator.ts b/packages/ui-tooltip/src/Tooltip/TooltipLocator.ts
deleted file mode 100644
index 0fd83a4ea7..0000000000
--- a/packages/ui-tooltip/src/Tooltip/TooltipLocator.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-import { parseQueryArguments } from '@instructure/ui-test-queries'
-// @ts-ignore: Cannot find module
-// eslint-disable-next-line no-restricted-imports
-import { PopoverLocator } from '@instructure/ui-popover/es/Popover/PopoverLocator'
-import { Tooltip } from './index'
-
-export const customMethods = {
- findTrigger: (...args: any[]) => {
- const { element, options } = parseQueryArguments(...args)
- return PopoverLocator.findTrigger(element, '[aria-describedby]', options)
- },
- findContent: (...args: any[]) => {
- const { element, options } = parseQueryArguments(...args)
- return PopoverLocator.findContent(element, '[role="tooltip"]', options)
- }
-}
-// @ts-ignore: Property 'selector' does not exist type Tooltip
-export const TooltipLocator = locator(Tooltip.selector, customMethods)
diff --git a/packages/ui-tooltip/src/Tooltip/__new-tests__/Tooltip.test.tsx b/packages/ui-tooltip/src/Tooltip/__tests__/Tooltip.test.tsx
similarity index 100%
rename from packages/ui-tooltip/src/Tooltip/__new-tests__/Tooltip.test.tsx
rename to packages/ui-tooltip/src/Tooltip/__tests__/Tooltip.test.tsx
diff --git a/packages/ui-tooltip/src/Tooltip/locator.ts b/packages/ui-tooltip/src/Tooltip/locator.ts
deleted file mode 100644
index 2c24ce038a..0000000000
--- a/packages/ui-tooltip/src/Tooltip/locator.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { TooltipLocator } from './TooltipLocator'
-
-export { customMethods } from './TooltipLocator'
-
-export { TooltipLocator }
-export default TooltipLocator
diff --git a/packages/ui-tooltip/tsconfig.build.json b/packages/ui-tooltip/tsconfig.build.json
index cd9ee4e767..98130dbc0b 100644
--- a/packages/ui-tooltip/tsconfig.build.json
+++ b/packages/ui-tooltip/tsconfig.build.json
@@ -17,8 +17,6 @@
{ "path": "../ui-testable/tsconfig.build.json" },
{ "path": "../ui-babel-preset/tsconfig.build.json" },
{ "path": "../ui-color-utils/tsconfig.build.json" },
- { "path": "../ui-test-locator/tsconfig.build.json" },
- { "path": "../ui-test-queries/tsconfig.build.json" },
{ "path": "../ui-test-utils/tsconfig.build.json" },
{ "path": "../ui-utils/tsconfig.build.json" },
{ "path": "../ui-themes/tsconfig.build.json" },
diff --git a/packages/ui-top-nav-bar/package.json b/packages/ui-top-nav-bar/package.json
index 9018138076..60283122a1 100644
--- a/packages/ui-top-nav-bar/package.json
+++ b/packages/ui-top-nav-bar/package.json
@@ -53,7 +53,6 @@
"@instructure/ui-babel-preset": "10.19.1",
"@instructure/ui-color-utils": "10.19.1",
"@instructure/ui-scripts": "10.19.1",
- "@instructure/ui-test-locator": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@instructure/ui-themes": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarActionItems/__new-tests__/TopNavBarActionItems.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarActionItems/__tests__/TopNavBarActionItems.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarActionItems/__new-tests__/TopNavBarActionItems.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarActionItems/__tests__/TopNavBarActionItems.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts
deleted file mode 100644
index 9fd8216fc4..0000000000
--- a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/TopNavBarBrandLocator.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { locator } from '@instructure/ui-test-locator'
-import { find } from '@instructure/ui-test-utils'
-
-import { TopNavBarBrand } from './index'
-
-// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
-export const TopNavBarBrandLocator = locator(TopNavBarBrand.selector, {
- findContainer: (...args: any[]) => {
- return find('[class$="-topNavBarBrand__container"]', ...args)
- },
- findBrandIconContainer: (...args: any[]) => {
- return find('[class$="-topNavBarBrand__iconContainer"]', ...args)
- },
- findScreenReaderLabel: (...args: any[]) => {
- return find('[class$="-screenReaderContent"]', ...args)
- }
-})
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__examples__/TopNavBarBrand.examples.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__examples__/TopNavBarBrand.examples.tsx
deleted file mode 100644
index 2e0bf5e003..0000000000
--- a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__examples__/TopNavBarBrand.examples.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import type { StoryConfig } from '@instructure/ui-test-utils'
-
-import { elevateIconInverse } from '../../utils/exampleSvgFiles'
-import type { TopNavBarBrandProps } from '../props'
-
-export default {
- propValues: {
- renderIcon: [undefined, 'Logo', elevateIconInverse],
- iconBackground: [undefined, '#ddd'],
- href: [undefined, '/#home'],
- onClick: [undefined, () => {}]
- },
- getComponentProps: () => {
- return {
- screenReaderLabel: 'Brand name'
- }
- },
- filter: (props) => {
- if (props.iconBackground && !props.renderIcon) {
- return true
- }
- if (
- (props.href || props.onClick) &&
- !(typeof props.renderIcon === 'object' && props.iconBackground)
- ) {
- return true
- }
- return false
- }
-} as StoryConfig
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__tests__/TopNavBarBrand.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__tests__/TopNavBarBrand.test.tsx
deleted file mode 100644
index 1ecc0ea443..0000000000
--- a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBrand/__tests__/TopNavBarBrand.test.tsx
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { getComputedStyle } from '@instructure/ui-dom-utils'
-import {
- expect,
- mount,
- generateA11yTests,
- stub
-} from '@instructure/ui-test-utils'
-
-import { getBrand, SmallViewportModeWrapper } from '../../utils/exampleHelpers'
-import { elevateIcon } from '../../utils/exampleSvgFiles'
-
-import { TopNavBarBrand } from '../index'
-import { TopNavBarBrandLocator } from '../TopNavBarBrandLocator'
-import TopNavBarBrandExamples from '../__examples__/TopNavBarBrand.examples'
-
-describe('', async () => {
- it('should render', async () => {
- await mount(getBrand({}))
- const component = await TopNavBarBrandLocator.find()
-
- expect(component).to.exist()
- })
-
- describe('elementRef prop should return a ref to the root element', async () => {
- it('should return root element', async () => {
- const elementRef = stub()
- await mount(
- getBrand({
- brandProps: { elementRef }
- })
- )
- const component = await TopNavBarBrandLocator.find()
-
- expect(elementRef).to.have.been.calledWith(component.getDOMNode())
- })
- })
-
- describe('screenReaderLabel prop', async () => {
- it('should render label for SR', async () => {
- await mount(
- getBrand({
- brandProps: { screenReaderLabel: 'Test label' }
- })
- )
- const component = await TopNavBarBrandLocator.find()
- const screenReaderLabel = await component.findScreenReaderLabel()
-
- expect(screenReaderLabel).to.have.text('Test label')
- })
- })
-
- describe('renderIcon prop', async () => {
- it('should render name in desktop mode', async () => {
- await mount(getBrand({ brandProps: { renderIcon: elevateIcon } }))
- const component = await TopNavBarBrandLocator.find()
- const iconContainer = await component.findBrandIconContainer()
- const icon = await iconContainer.find('svg')
-
- expect(iconContainer).to.be.visible()
- expect(icon).to.be.visible()
- expect(icon).to.have.id('elevateIcon')
- })
-
- it('should not render name in smallViewport mode', async () => {
- await mount(
-
- {getBrand({ brandProps: { renderIcon: elevateIcon } })}
-
- )
- const component = await TopNavBarBrandLocator.find()
- const iconContainer = await component.findBrandIconContainer({
- expectEmpty: true
- })
-
- expect(iconContainer).to.not.exist()
- })
- })
-
- describe('iconBackground prop', async () => {
- it('should be visible in desktop mode', async () => {
- await mount(getBrand({ brandProps: { iconBackground: 'blue' } }))
- const component = await TopNavBarBrandLocator.find()
- const iconContainer = await component.findBrandIconContainer()
-
- expect(
- getComputedStyle(iconContainer.getDOMNode()).backgroundColor
- ).to.equal('rgb(0, 0, 255)')
- })
-
- it('should not be visible in smallViewport mode', async () => {
- await mount(
-
- {getBrand({ brandProps: { iconBackground: 'blue' } })}
-
- )
- const component = await TopNavBarBrandLocator.find()
- const iconContainer = await component.findBrandIconContainer({
- expectEmpty: true
- })
-
- expect(iconContainer).to.not.exist()
- })
- })
-
- describe('href prop', async () => {
- it('should render component as link', async () => {
- await mount(
- getBrand({
- brandProps: { href: '/#TestHref' }
- })
- )
- const component = await TopNavBarBrandLocator.find()
- const container = await component.findContainer()
-
- expect(container).to.have.tagName('a')
- expect(container).to.have.attribute('href', '/#TestHref')
- })
- })
-
- describe('onClick prop', async () => {
- it('should render component button', async () => {
- const onClick = stub()
- await mount(
- getBrand({
- brandProps: { href: undefined, onClick }
- })
- )
- const component = await TopNavBarBrandLocator.find()
- const container = await component.findContainer()
-
- expect(container).to.have.tagName('button')
-
- await container.click()
-
- expect(onClick).to.have.been.called()
- })
- })
-
- describe('as prop', async () => {
- it('should render component as passed element', async () => {
- const onClick = stub()
- await mount(
- getBrand({
- brandProps: { href: '/#TestHref', onClick, as: 'button' }
- })
- )
- const component = await TopNavBarBrandLocator.find()
- const container = await component.findContainer()
-
- expect(container).to.have.tagName('button')
-
- await container.click()
-
- expect(onClick).to.have.been.called()
- })
- })
-
- describe('should be accessible', async () => {
- generateA11yTests(TopNavBarBrand, TopNavBarBrandExamples)
-
- it('a11y', async () => {
- await mount(getBrand({}))
- const topNavBarBrand = await TopNavBarBrandLocator.find()
- expect(await topNavBarBrand.accessible()).to.be.true()
- })
- })
-})
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBreadcrumb/__new-tests__/TopNavBarBreadcrumb.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBreadcrumb/__tests__/TopNavBarBreadcrumb.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBreadcrumb/__new-tests__/TopNavBarBreadcrumb.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarBreadcrumb/__tests__/TopNavBarBreadcrumb.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarItem/__new-tests__/TopNavBarItem.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarItem/__tests__/TopNavBarItem.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarItem/__new-tests__/TopNavBarItem.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarItem/__tests__/TopNavBarItem.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/DesktopLayout/__new-tests__/TopNavBarDesktopLayout.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/DesktopLayout/__tests__/TopNavBarDesktopLayout.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/DesktopLayout/__new-tests__/TopNavBarDesktopLayout.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/DesktopLayout/__tests__/TopNavBarDesktopLayout.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/__new-tests__/TopNavBarSmallViewportLayout.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/__tests__/TopNavBarSmallViewportLayout.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/__new-tests__/TopNavBarSmallViewportLayout.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/SmallViewportLayout/__tests__/TopNavBarSmallViewportLayout.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/__new-tests__/TopNavBarLayout.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/__tests__/TopNavBarLayout.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/__new-tests__/TopNavBarLayout.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarLayout/__tests__/TopNavBarLayout.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarMenuItems/__new-tests__/TopNavBarMenuItems.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarMenuItems/__tests__/TopNavBarMenuItems.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarMenuItems/__new-tests__/TopNavBarMenuItems.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarMenuItems/__tests__/TopNavBarMenuItems.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarUser/__new-tests__/TopNavBarUser.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/TopNavBarUser/__tests__/TopNavBarUser.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/TopNavBarUser/__new-tests__/TopNavBarUser.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/TopNavBarUser/__tests__/TopNavBarUser.test.tsx
diff --git a/packages/ui-top-nav-bar/src/TopNavBar/__new-tests__/TopNavBar.test.tsx b/packages/ui-top-nav-bar/src/TopNavBar/__tests__/TopNavBar.test.tsx
similarity index 100%
rename from packages/ui-top-nav-bar/src/TopNavBar/__new-tests__/TopNavBar.test.tsx
rename to packages/ui-top-nav-bar/src/TopNavBar/__tests__/TopNavBar.test.tsx
diff --git a/packages/ui-top-nav-bar/tsconfig.build.json b/packages/ui-top-nav-bar/tsconfig.build.json
index f6fc8d6b67..c5851724f8 100644
--- a/packages/ui-top-nav-bar/tsconfig.build.json
+++ b/packages/ui-top-nav-bar/tsconfig.build.json
@@ -31,7 +31,6 @@
{ "path": "../ui-view/tsconfig.build.json" },
{ "path": "../ui-babel-preset/tsconfig.build.json" },
{ "path": "../ui-color-utils/tsconfig.build.json" },
- { "path": "../ui-test-locator/tsconfig.build.json" },
{ "path": "../ui-test-utils/tsconfig.build.json" },
{ "path": "../ui-themes/tsconfig.build.json" },
{ "path": "../ui-axe-check/tsconfig.build.json" },
diff --git a/packages/ui-tray/src/Tray/__new-tests__/Tray.test.tsx b/packages/ui-tray/src/Tray/__tests__/Tray.test.tsx
similarity index 100%
rename from packages/ui-tray/src/Tray/__new-tests__/Tray.test.tsx
rename to packages/ui-tray/src/Tray/__tests__/Tray.test.tsx
diff --git a/packages/ui-tree-browser/src/TreeBrowser/TreeButton/__new-tests__/TreeButton.test.tsx b/packages/ui-tree-browser/src/TreeBrowser/TreeButton/__tests__/TreeButton.test.tsx
similarity index 100%
rename from packages/ui-tree-browser/src/TreeBrowser/TreeButton/__new-tests__/TreeButton.test.tsx
rename to packages/ui-tree-browser/src/TreeBrowser/TreeButton/__tests__/TreeButton.test.tsx
diff --git a/packages/ui-tree-browser/src/TreeBrowser/TreeCollection/__new-tests__/TreeCollection.test.tsx b/packages/ui-tree-browser/src/TreeBrowser/TreeCollection/__tests__/TreeCollection.test.tsx
similarity index 100%
rename from packages/ui-tree-browser/src/TreeBrowser/TreeCollection/__new-tests__/TreeCollection.test.tsx
rename to packages/ui-tree-browser/src/TreeBrowser/TreeCollection/__tests__/TreeCollection.test.tsx
diff --git a/packages/ui-tree-browser/src/TreeBrowser/TreeNode/__new-tests__/TreeNode.test.tsx b/packages/ui-tree-browser/src/TreeBrowser/TreeNode/__tests__/TreeNode.test.tsx
similarity index 100%
rename from packages/ui-tree-browser/src/TreeBrowser/TreeNode/__new-tests__/TreeNode.test.tsx
rename to packages/ui-tree-browser/src/TreeBrowser/TreeNode/__tests__/TreeNode.test.tsx
diff --git a/packages/ui-tree-browser/src/TreeBrowser/__new-tests__/TreeBrowser.test.tsx b/packages/ui-tree-browser/src/TreeBrowser/__tests__/TreeBrowser.test.tsx
similarity index 100%
rename from packages/ui-tree-browser/src/TreeBrowser/__new-tests__/TreeBrowser.test.tsx
rename to packages/ui-tree-browser/src/TreeBrowser/__tests__/TreeBrowser.test.tsx
diff --git a/packages/ui-truncate-list/package.json b/packages/ui-truncate-list/package.json
index 8640e16f5f..f89008411a 100644
--- a/packages/ui-truncate-list/package.json
+++ b/packages/ui-truncate-list/package.json
@@ -38,7 +38,6 @@
"@instructure/ui-axe-check": "10.19.1",
"@instructure/ui-babel-preset": "10.19.1",
"@instructure/ui-color-utils": "10.19.1",
- "@instructure/ui-test-queries": "10.19.1",
"@instructure/ui-test-utils": "10.19.1",
"@instructure/ui-themes": "10.19.1",
"@testing-library/jest-dom": "^6.6.3",
diff --git a/packages/ui-truncate-list/src/TruncateList/__new-tests__/TruncateList.test.tsx b/packages/ui-truncate-list/src/TruncateList/__tests__/TruncateList.test.tsx
similarity index 100%
rename from packages/ui-truncate-list/src/TruncateList/__new-tests__/TruncateList.test.tsx
rename to packages/ui-truncate-list/src/TruncateList/__tests__/TruncateList.test.tsx
diff --git a/packages/ui-truncate-list/tsconfig.build.json b/packages/ui-truncate-list/tsconfig.build.json
index df496e52d1..af90e6dc9d 100644
--- a/packages/ui-truncate-list/tsconfig.build.json
+++ b/packages/ui-truncate-list/tsconfig.build.json
@@ -18,7 +18,6 @@
{ "path": "../ui-utils/tsconfig.build.json" },
{ "path": "../ui-babel-preset/tsconfig.build.json" },
{ "path": "../ui-color-utils/tsconfig.build.json" },
- { "path": "../ui-test-queries/tsconfig.build.json" },
{ "path": "../ui-test-utils/tsconfig.build.json" },
{ "path": "../ui-themes/tsconfig.build.json" }
]
diff --git a/packages/ui-truncate-text/src/TruncateText/__new-tests__/TruncateText.test.tsx b/packages/ui-truncate-text/src/TruncateText/__tests__/TruncateText.test.tsx
similarity index 100%
rename from packages/ui-truncate-text/src/TruncateText/__new-tests__/TruncateText.test.tsx
rename to packages/ui-truncate-text/src/TruncateText/__tests__/TruncateText.test.tsx
diff --git a/packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/cleanData.test.tsx b/packages/ui-truncate-text/src/TruncateText/utils/__tests__/cleanData.test.tsx
similarity index 100%
rename from packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/cleanData.test.tsx
rename to packages/ui-truncate-text/src/TruncateText/utils/__tests__/cleanData.test.tsx
diff --git a/packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/cleanString.test.tsx b/packages/ui-truncate-text/src/TruncateText/utils/__tests__/cleanString.test.tsx
similarity index 100%
rename from packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/cleanString.test.tsx
rename to packages/ui-truncate-text/src/TruncateText/utils/__tests__/cleanString.test.tsx
diff --git a/packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/measureText.test.tsx b/packages/ui-truncate-text/src/TruncateText/utils/__tests__/measureText.test.tsx
similarity index 100%
rename from packages/ui-truncate-text/src/TruncateText/utils/__new-tests__/measureText.test.tsx
rename to packages/ui-truncate-text/src/TruncateText/utils/__tests__/measureText.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/camelize.test.tsx b/packages/ui-utils/src/__tests__/camelize.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/camelize.test.tsx
rename to packages/ui-utils/src/__tests__/camelize.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/cloneArray.test.tsx b/packages/ui-utils/src/__tests__/cloneArray.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/cloneArray.test.tsx
rename to packages/ui-utils/src/__tests__/cloneArray.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/createChainedFunction.test.tsx b/packages/ui-utils/src/__tests__/createChainedFunction.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/createChainedFunction.test.tsx
rename to packages/ui-utils/src/__tests__/createChainedFunction.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/generateId.test.tsx b/packages/ui-utils/src/__tests__/generateId.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/generateId.test.tsx
rename to packages/ui-utils/src/__tests__/generateId.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/hash.test.tsx b/packages/ui-utils/src/__tests__/hash.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/hash.test.tsx
rename to packages/ui-utils/src/__tests__/hash.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/mergeDeep.test.tsx b/packages/ui-utils/src/__tests__/mergeDeep.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/mergeDeep.test.tsx
rename to packages/ui-utils/src/__tests__/mergeDeep.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/ms.test.tsx b/packages/ui-utils/src/__tests__/ms.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/ms.test.tsx
rename to packages/ui-utils/src/__tests__/ms.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/parseUnit.test.tsx b/packages/ui-utils/src/__tests__/parseUnit.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/parseUnit.test.tsx
rename to packages/ui-utils/src/__tests__/parseUnit.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/pascalize.test.tsx b/packages/ui-utils/src/__tests__/pascalize.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/pascalize.test.tsx
rename to packages/ui-utils/src/__tests__/pascalize.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/px.test.tsx b/packages/ui-utils/src/__tests__/px.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/px.test.tsx
rename to packages/ui-utils/src/__tests__/px.test.tsx
diff --git a/packages/ui-utils/src/__new-tests__/within.test.tsx b/packages/ui-utils/src/__tests__/within.test.tsx
similarity index 100%
rename from packages/ui-utils/src/__new-tests__/within.test.tsx
rename to packages/ui-utils/src/__tests__/within.test.tsx
diff --git a/packages/ui-view/src/ContextView/__new-tests__/ContextView.test.tsx b/packages/ui-view/src/ContextView/__tests__/ContextView.test.tsx
similarity index 100%
rename from packages/ui-view/src/ContextView/__new-tests__/ContextView.test.tsx
rename to packages/ui-view/src/ContextView/__tests__/ContextView.test.tsx
diff --git a/packages/ui-view/src/View/__new-tests__/View.test.tsx b/packages/ui-view/src/View/__tests__/View.test.tsx
similarity index 100%
rename from packages/ui-view/src/View/__new-tests__/View.test.tsx
rename to packages/ui-view/src/View/__tests__/View.test.tsx
diff --git a/packages/ui-view/src/View/__tests__/theme.test.ts b/packages/ui-view/src/View/__tests__/theme.test.ts
deleted file mode 100644
index 77736253b2..0000000000
--- a/packages/ui-view/src/View/__tests__/theme.test.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2015 - present Instructure, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-import { expect } from '@instructure/ui-test-utils'
-import { contrast } from '@instructure/ui-color-utils'
-import { canvas, canvasHighContrast } from '@instructure/ui-themes'
-
-import generateComponentTheme from '../theme'
-
-describe('View.theme', () => {
- describe('with the default theme', () => {
- const variables = generateComponentTheme(canvas)
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundPrimary, variables.color)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(
- variables.backgroundPrimaryInverse,
- variables.colorPrimaryInverse
- )
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundSecondary, variables.color)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundBrand, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundAlert, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundInfo, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundSuccess, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundDanger, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
-
- it('should have a background and text colors that meet 3:1 contrast', () => {
- expect(
- contrast(variables.backgroundWarning, variables.colorPrimaryInverse)
- ).to.be.above(3)
- })
- })
-
- describe('with the high contrast canvas theme', async () => {
- const variables = generateComponentTheme(canvasHighContrast)
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundPrimary, variables.color)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(
- variables.backgroundPrimaryInverse,
- variables.colorPrimaryInverse
- )
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundSecondary, variables.color)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundBrand, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundAlert, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundInfo, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundSuccess, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundDanger, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
-
- it('should have a background and text colors that meet 4.5:1 contrast', () => {
- expect(
- contrast(variables.backgroundWarning, variables.colorPrimaryInverse)
- ).to.be.above(4.5)
- })
- })
-})
diff --git a/packages/uid/src/__new-tests__/uid.test.tsx b/packages/uid/src/__tests__/uid.test.tsx
similarity index 100%
rename from packages/uid/src/__new-tests__/uid.test.tsx
rename to packages/uid/src/__tests__/uid.test.tsx
diff --git a/vitest.config.mts b/vitest.config.mts
index 4b561bf239..6fa262be5b 100644
--- a/vitest.config.mts
+++ b/vitest.config.mts
@@ -28,7 +28,7 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
- include: ['**/__new-tests__/**/*.test.tsx'],
+ include: ['**/__tests__/**/*.test.tsx'],
globals: true,
environment: 'jsdom',
setupFiles: './vitest.setup.ts'