Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* 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, find } from '@instructure/ui-test-utils'
// eslint-disable-next-line no-restricted-imports
import TooltipLocator from '@instructure/ui-overlays/lib/Tooltip/locator'
import { PaginationArrowButton } from './index'
export default locator(PaginationArrowButton.selector, {
findTooltipContent: (...args) => TooltipLocator.findContent(...args),
click: async (element, ...args) => {
return (await find(element, 'a,button,[role="button"]')).click(...args)
}
})
* 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, parseQueryArguments } from '@instructure/ui-test-utils'
// eslint-disable-next-line no-restricted-imports
import TooltipLocator from '@instructure/ui-overlays/lib/Tooltip/locator'
import { Pill } from './index'
export default locator(Pill.selector, {
findTooltipContent: async (...args) => {
const { element, selector, options } = parseQueryArguments(...args)
const tooltip = await TooltipLocator.find(element, options)
return tooltip ? tooltip.findContent(selector, options) : null
}
})
import { locator } from '@instructure/ui-test-utils'
// eslint-disable-next-line no-restricted-imports
import PositionLocator from '@instructure/ui-layout/lib/Position/locator'
import { Popover, PopoverTrigger, PopoverContent } from './index'
export const PopoverTriggerLocator = locator(PopoverTrigger.selector)
export const PopoverContentLocator = locator(PopoverContent.selector)
export const customMethods = {
findContent: (...args) => PositionLocator.findContent(...args),
findPositionTarget: (...args) => PositionLocator.findTarget(...args),
findTrigger: (...args) => PopoverTriggerLocator.find(...args)
}
export default locator(Popover.selector, customMethods)
findPopoverTrigger: (...args) => {
return PopoverLocator.findTrigger(...args)
},
findPopoverContent: (...args) => {
const { element, selector, options } = parseQueryArguments(...args)
return PopoverLocator.findContent(element, selector, {
...options,
customMethods: {
...options.customMethods,
...customMethods
}
})
}
}
export default locator(Menu.selector, customMethods)
export { default as MenuItemLocator } from './MenuItem/locator'
export { default as MenuItemGroupLocator } from './MenuItemGroup/locator'
* 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-utils'
import Rating from './index'
import styles from './RatingIcon/styles.css'
const FilledIconLocator = locator(`.${styles.filled}`)
export default locator(Rating.selector, {
findAllFilledIcons: (...args) => {
return FilledIconLocator.findAll(...args)
}
})
* 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-utils'
import Spinner from './index'
export default locator(Spinner.selector)
* 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-utils'
import { BreadcrumbLink } from './index'
export default locator(BreadcrumbLink.selector)
findInput: (...args) => locator('input').find(...args),
findOptionsList: async (element, ...args) => {
* 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-utils'
import InlineSVG from './index'
export default locator(InlineSVG.selector)
* 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-utils'
import Tabs from './index'
import TabLocator from './Tab/locator'
import PanelLocator from './Panel/locator'
const SelectedTabLocator = locator('[role="tab"][aria-selected="true"]')
export default locator(Tabs.selector, {
findTab: (...args) => {
return TabLocator.find(...args)
},
findAllTabs: (...args) => {
return TabLocator.findAll(...args)
},
findSelectedTab: (...args) => {
return SelectedTabLocator.find( ...args)
},
findTabPanel: (...args) => {
return PanelLocator.find(...args)
},
findAllTabPanels: (...args) => {
return PanelLocator.findAll(...args)
}
})