Skip to content

Commit

Permalink
chore: updated dev dependencies (#96) (#97)
Browse files Browse the repository at this point in the history
* chore: updated typescript (#96)

* chore: updated typescript and eslint plugins (#96)

* chore: updated lint plugins, fixed sonar issues (#96)

* chore: updated playwright and linters (#96)

* chore: updated commitlint (#96)

* chore: updated next/eslint-plugin-next (#96)

* chore: updated playwright (#96)

* chore: updated jest (#96)

* chore: updated babel-loader (#96)

* chore: updated csv-parse (#96)

* chore: updated husky and avoided deprecation warnings (#96)

* fix: moved typescript eslint plugin to devdependencies (#96)

* fix: removed eslint-disable from playwright config (#96)

* fix: remove `eslint-disable` comment (#96)

---------

Co-authored-by: hunterckx <118154470+hunterckx@users.noreply.github.com>
  • Loading branch information
jpaten and hunterckx authored Dec 10, 2024
1 parent 89b426c commit f8e17c1
Show file tree
Hide file tree
Showing 10 changed files with 3,263 additions and 2,483 deletions.
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

0 comments on commit f8e17c1

Please sign in to comment.