Skip to content

Commit

Permalink
update report viewer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Nov 28, 2024
1 parent 7f1b63e commit dad1a4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion report-viewer/tests/e2e/Cluster.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ function compareTableRow(
similarityMAX: number
) {
expect(table).toContain(
`${row}${id1}${id2}${similarityAVG.toFixed(2)}% ${similarityMAX.toFixed(2)}%`
`${row}${id1}${id2}${similarityAVG.toFixed(2)}%${similarityMAX.toFixed(2)}%`
)
}
5 changes: 3 additions & 2 deletions report-viewer/tests/e2e/Comparison.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ test('Test comparison table and comparsion view', async ({ page }) => {

await uploadFile('progpedia-report.zip', page)

const comparisonContainer = page.getByText('Hide AllSort By')
const comparisonContainer = page.getByText('Hide AllSorting Metric')

// check for elements in average similarity table
await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Purple')
const comparisonTableAverageSorted = await page.getByText(/Cluster[0-9]/).textContent()
expect(comparisonTableAverageSorted).toContain('100Purple FishBeige Dog')

await comparisonContainer.getByText('Maximum Similarity', { exact: true }).click()
const sortingMetricSelector = comparisonContainer.getByText('Sorting Metric:Average')
await sortingMetricSelector.getByText('Maximum', { exact: true }).click()
// check for elements in maximum similarity table
await page.getByPlaceholder('Filter/Unhide Comparisons').fill('Blue')
const comparisonTableMaxSorted = await page.getByText(/Cluster[0-9]/).textContent()
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/tests/e2e/Distribution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function selectOptions(page: Page, options: string[]) {

function getTestCombinations() {
const options = [
['Average Similarity', 'Maximum Similarity'],
['Average', 'Maximum'],
['Linear', 'Logarithmic'],
['10', '20', '25', '50', '100']
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ describe('OptionSelectorComponent', () => {
})

expect(wrapper.text()).toContain('Test:')
expect(wrapper.text()).toContain('Average Similarity')
expect(wrapper.text()).toContain('Minimum Similarity')
expect(wrapper.text()).not.toContain('Maximum Similarity')
expect(wrapper.text()).toContain('Average')
expect(wrapper.text()).toContain('Minimum')
expect(wrapper.text()).not.toContain('Maximum')
})

it('switch selection', async () => {
Expand Down

0 comments on commit dad1a4a

Please sign in to comment.