Skip to content

Commit

Permalink
AG-1435: improve test naming
Browse files Browse the repository at this point in the history
  • Loading branch information
hallieswan committed May 2, 2024
1 parent 1444410 commit c9f37fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
6 changes: 4 additions & 2 deletions tests/gene-comparison-tool-pinning-ui.spc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ test.describe('GCT: Pinning Genes via UI', () => {
});
});

test('genes can be pinned from quick filters', async ({ page }) => {
test('only 50 genes are pinned when pinning all genes matched by a quick filter', async ({
page,
}) => {
await page.goto(URL_GCT);
await expectGctPageLoaded(
page,
GCT_CATEGORIES.RNA,
GCT_RNA_SUBCATEGORIES.AD
);

await test.step('only 50 genes are pinned when pinning all genes matched by a quick filter', async () => {
await test.step('apply a quick filter', async () => {
await page.getByRole('button', { name: 'Filter Genes' }).click();
await page.getByRole('button', { name: 'Quick Filters' }).click();
await page.getByText('All Nominated targets').click();
Expand Down
22 changes: 11 additions & 11 deletions tests/gene-comparison-tool-pinning-url.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from './helpers/gct-pinning';

test.describe('GCT: Pinning Genes from URL', () => {
test('when rna differential expression url does not include pinned genes, no genes are pinned', async ({
test('when RNA url does not include pinned genes, no genes are pinned', async ({
page,
}) => {
await page.goto(URL_GCT);
Expand All @@ -41,7 +41,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
await confirmPinnedItemsCount(page, 0);
});

test('when protein differential expression url does not include pinned genes, no genes are pinned', async ({
test('when Protein url does not include pinned genes, no genes are pinned', async ({
page,
}) => {
await page.goto(URL_GCT_PROTEIN);
Expand All @@ -56,7 +56,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
await confirmPinnedItemsCount(page, 0);
});

test('when rna differential expression url includes 50 pinned genes, all genes are pinned', async ({
test('when RNA url includes 50 pinned genes, all genes are pinned', async ({
page,
}) => {
const url = `${URL_GCT}?${formatPinnedGenesQueryParam(fiftyGenes)}`;
Expand All @@ -82,7 +82,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
});
});

test('when rna differential expression url includes >50 pinned genes, only 50 genes are pinned and toast is displayed', async ({
test('when RNA url includes >50 pinned genes, only 50 genes are pinned and toast is displayed', async ({
page,
}) => {
const url = `${URL_GCT}?${formatPinnedGenesQueryParam(fiftyOneGenes)}`;
Expand All @@ -108,7 +108,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
});
});

test('when rna differential expression url includes invalid gene, that gene is dropped from the url', async ({
test('when RNA url includes invalid gene, that gene is dropped from the url', async ({
page,
}) => {
const validGeneId = geneWithMultipleProteinsTMT.ensemblId;
Expand Down Expand Up @@ -141,7 +141,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
});
});

test('when rna differential expression url includes proteins, the related gene is pinned', async ({
test('when RNA url includes proteins, the related gene is pinned', async ({
page,
}) => {
const geneProteins = geneWithMultipleProteinsTMT.uniProtIds.map(
Expand All @@ -166,7 +166,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
});

test.fail(
'when protein differential expression url includes a gene, all related proteins are pinned',
'when Protein url includes a gene, all related proteins are pinned',
async ({ page }) => {
const url = `${URL_GCT_PROTEIN_TMT}&${formatPinnedGenesQueryParam([
geneWithMultipleProteinsTMT.ensemblId,
Expand Down Expand Up @@ -194,7 +194,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
);

test.fail(
'when protein differential expression url includes 50 proteins from 50 unique genes, all proteins are pinned',
'when Protein url includes 50 proteins from 50 unique genes, all proteins are pinned',
async ({ page }) => {
const url = `${URL_GCT_PROTEIN_TMT}&${formatPinnedGenesQueryParam(
fiftyProteinsToFiftyUniqueGenesTMT
Expand All @@ -216,7 +216,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
);

test.fail(
'when protein differential expression url includes >50 proteins from 50 unique genes, all proteins are pinned',
'when Protein url includes >50 proteins from 50 unique genes, all proteins are pinned',
async ({ page }) => {
const fortyNineProteinsToUniqueGenes =
fiftyProteinsToFiftyUniqueGenesTMT.slice(0, -1);
Expand Down Expand Up @@ -261,7 +261,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
);

test.fail(
'when protein differential expression url includes proteins from 51 unique genes, only proteins from 50 genes are pinned',
'when Protein url includes proteins from 51 unique genes, only proteins from 50 genes are pinned',
async ({ page }) => {
const oneGeneWithManyProteins =
geneWithMultipleProteinsTMT.uniProtIds.map(
Expand Down Expand Up @@ -304,7 +304,7 @@ test.describe('GCT: Pinning Genes from URL', () => {
);

test.fail(
'when protein differential expression url includes invalid protein, that protein is dropped from the url',
'when Protein url includes invalid protein, that protein is dropped from the url',
async ({ page }) => {
const validGeneProtein = fiftyProteinsToFiftyUniqueGenesTMT[1];
const url = `${URL_GCT_PROTEIN_TMT}&${formatPinnedGenesQueryParam([
Expand Down

0 comments on commit c9f37fc

Please sign in to comment.