mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00

* chore: cypress version is updated * chore: tsconfig is updated * update: default fixture json for the api are added * feat: redux-store is exposed to the Cypress * test: Login test is updated * test: global time test for default and metrics application is updated * chore: removed duplicate test case and commented unused lines
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import {
|
|
getDefaultOption,
|
|
getOptions,
|
|
} from 'container/Header/DateTimeSelection/config';
|
|
// import { AppState } from 'store/reducers';
|
|
|
|
const CheckRouteDefaultGlobalTimeOptions = ({
|
|
route,
|
|
}: CheckRouteDefaultGlobalTimeOptionsProps): void => {
|
|
cy.visit(Cypress.env('baseUrl') + route);
|
|
|
|
const allOptions = getOptions(route);
|
|
|
|
const defaultValue = getDefaultOption(route);
|
|
|
|
const defaultSelectedOption = allOptions.find((e) => e.value === defaultValue);
|
|
|
|
expect(defaultSelectedOption).not.undefined;
|
|
|
|
cy
|
|
.findAllByTestId('dropDown')
|
|
.find('span')
|
|
.then((el) => {
|
|
const elements = el.get();
|
|
|
|
const item = elements[1];
|
|
|
|
expect(defaultSelectedOption?.label).to.be.equals(
|
|
item.innerText,
|
|
'Default option is not matching',
|
|
);
|
|
});
|
|
|
|
// cy
|
|
// .window()
|
|
// .its('store')
|
|
// .invoke('getState')
|
|
// .then((e: AppState) => {
|
|
// const { globalTime } = e;
|
|
// const { maxTime, minTime } = globalTime;
|
|
// // @TODO match the global min time and max time according to the selected option
|
|
// });
|
|
};
|
|
|
|
export interface CheckRouteDefaultGlobalTimeOptionsProps {
|
|
route: string;
|
|
}
|
|
|
|
export default CheckRouteDefaultGlobalTimeOptions;
|