diff --git a/nightwatch/components/filterdropdown.spec.tsx b/nightwatch/components/filterdropdown.spec.tsx new file mode 100644 index 0000000..67ffbf4 --- /dev/null +++ b/nightwatch/components/filterdropdown.spec.tsx @@ -0,0 +1,36 @@ +import { Component, useState } from 'react'; +import FilterDropdown from '../../src/components/FilterDropdown'; +import GlobalStyles from '../../src/components/GlobalStyles'; +import { GlobalContextProvider } from '../utils/TestGlobalContextProvider'; + +export default { + title: 'FilterDropdown Component', + component: FilterDropdown +}; + +export const FilterDropdownComponent = () => { + const [filterContext, setFilterContext] = useState('All Tests'); + + return ( + <> + + + + + + ); +}; + +FilterDropdownComponent.test = async (browser, { component }) => { + const filterDropdownButton = element('button[aria-label="Customize options"]'); + + // Testing whether the button is visible + browser.expect(filterDropdownButton).to.be.visible; + // Testing whether the button is clickable + browser.element('button[aria-label="Customize options"]').click(); + // Testing whether the button shows "All Tests" as default selection + browser.expect(filterDropdownButton).text.to.equal('All Tests'); +};