Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updated dev dependencies (#96) #97

Merged
merged 14 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prettier",
"plugin:prettier/recommended",
"next",
"plugin:sonarjs/recommended",
"plugin:sonarjs/recommended-legacy",
"plugin:eslint-comments/recommended"
],
"rules": {
Expand Down Expand Up @@ -57,7 +57,8 @@
"jsdoc/require-returns-description": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-param-names": "error",
"react-hooks/exhaustive-deps": "error"
"react-hooks/exhaustive-deps": "error",
"sonarjs/todo-tag": "warn"
},
"overrides": [
{
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "Checking commit message"

# Check for issue number
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo '🏗️👷 Checking your project before committing'

# Check Prettier
Expand Down
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"trailingComma": "es5"
}
14 changes: 8 additions & 6 deletions e2e/testFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export async function testTableExists(
export function escapeRegExp(string: string): string {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}

const MAX_FILTER_LENTGH = "256";

/**
* Returns a regex that matches the sidebar filter buttons
* This is useful for selecting a filter from the sidebar
Expand All @@ -61,17 +64,16 @@ export function escapeRegExp(string: string): string {
export const filterRegex = (filterName: string): RegExp =>
new RegExp("^(" + escapeRegExp(filterName) + ")" + "\\s+\\([0-9]+\\)\\s*");

const allFilterRegex = /^(.+)\s+\([0-9]+\)\s*/;
const allFilterRegex = new RegExp(
"^(.{0," + MAX_FILTER_LENTGH + "})\\s+\\(\\d+\\)\\s*"
);
/**
* Get an array of all filter names on the current page
* @param page - a Playwright Page object
* @returns - an array of filter names
*/
const getAllFilterNames = async (page: Page): Promise<string[]> => {
await expect(page.getByText(allFilterRegex).first()).toBeVisible();
/*await expect(page.getByText(allFilterRegex).first()).toContainText(
/\(([0-9])+\)/
);*/
const filterStrings = await page.getByText(allFilterRegex).allInnerTexts();
return filterStrings.map(
(x: string) => (x.match(allFilterRegex) ?? ["", ""])[1]
Expand Down Expand Up @@ -221,7 +223,7 @@ const verifyFilterCount = async (
page: Page,
expectedCount: number
): Promise<boolean> => {
const elementsPerPageRegex = /^Results 1 - ([0-9]+) of [0-9]+/;
const elementsPerPageRegex = /^Results 1 - (\d+) of \d+/;
await expect(page.getByText(elementsPerPageRegex)).toBeVisible();
const elementsPerPageText = ((
await page.getByText(elementsPerPageRegex).innerText()
Expand Down Expand Up @@ -318,7 +320,7 @@ const getFirstNonEmptyFilterOptionNameAndIndex = async (
let i = 0;
while (filterToSelect === "" && i < MAX_FILTER_OPTIONS_TO_CHECK) {
// Filter options display as "[text]\n[number]" , sometimes with extra whitespace, so we want the string before the newline
const filterOptionRegex = /^(.*)\n+([0-9]+)\s*$/;
const filterOptionRegex = /^(.*)\n+(\d+)\s*$/;
filterOptionLocator = getNthFilterOptionLocator(page, i);
filterToSelect = ((await filterOptionLocator.innerText())
.trim()
Expand Down
6 changes: 3 additions & 3 deletions e2e/testInterfaces.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface TabDescription {
preselectedColumns: columnDescription[];
preselectedColumns: ColumnDescription[];
searchFiltersPlaceholderText: string;
selectableColumns: columnDescription[];
selectableColumns: ColumnDescription[];
tabName: string;
url: string;
}
Expand All @@ -13,7 +13,7 @@ export interface HprcTabCollection {
rawSequencingData: TabDescription;
}

export interface columnDescription {
export interface ColumnDescription {
name: string;
sortable: boolean;
}
Loading
Loading