Update wording in the "sorting dropdown" of the variant analysis results view (#2373)

This commit is contained in:
Shati Patel
2023-04-27 10:41:32 +01:00
committed by GitHub
parent 8c9c38e1ae
commit af75fa9f2f
6 changed files with 22 additions and 18 deletions

View File

@@ -258,10 +258,10 @@ This requires running a MRVA query and seeing the results view.
2. When the file does not exist
7. Can open query text
8. Can sort repos
1. By name
2. By results
3. By stars
4. By last updated
1. Alphabetically
2. By number of results
3. By popularity
4. By most recent commit
9. Can filter repos
10. Shows correct statistics
1. Total number of results

View File

@@ -34,7 +34,7 @@ export const LastUpdated = ({ lastUpdated }: Props) => {
return (
<div>
<IconContainer>
<Codicon name="repo-push" label="Last updated" />
<Codicon name="repo-push" label="Most recent commit" />
</IconContainer>
<Duration>{humanizeRelativeTime(date.getTime() - Date.now())}</Duration>
</div>

View File

@@ -29,10 +29,14 @@ export const RepositoriesSort = ({ value, onChange, className }: Props) => {
return (
<Dropdown value={value} onInput={handleInput} className={className}>
<Codicon name="sort-precedence" label="Sort..." slot="indicator" />
<VSCodeOption value={SortKey.Name}>Name</VSCodeOption>
<VSCodeOption value={SortKey.ResultsCount}>Results</VSCodeOption>
<VSCodeOption value={SortKey.Stars}>Stars</VSCodeOption>
<VSCodeOption value={SortKey.LastUpdated}>Last updated</VSCodeOption>
<VSCodeOption value={SortKey.Name}>Alphabetically</VSCodeOption>
<VSCodeOption value={SortKey.ResultsCount}>
Number of results
</VSCodeOption>
<VSCodeOption value={SortKey.Stars}>Popularity</VSCodeOption>
<VSCodeOption value={SortKey.LastUpdated}>
Most recent commit
</VSCodeOption>
</Dropdown>
);
};

View File

@@ -39,7 +39,7 @@ describe(RepoRow.name, () => {
screen.queryByRole("img", {
// There should not be any icons, except for the icons which are always shown
name: (name) =>
!["expand", "stars count", "last updated"].includes(
!["expand", "stars count", "most recent commit"].includes(
name.toLowerCase(),
),
}),
@@ -293,7 +293,7 @@ describe(RepoRow.name, () => {
expect(screen.getByText("last month")).toBeInTheDocument();
expect(
screen.getByRole("img", {
name: "Last updated",
name: "Most recent commit",
}),
).toBeInTheDocument();
});
@@ -314,7 +314,7 @@ describe(RepoRow.name, () => {
).not.toBeInTheDocument();
expect(
screen.queryByRole("img", {
name: "Last updated",
name: "Most recent commit",
}),
).not.toBeInTheDocument();
});

View File

@@ -206,7 +206,7 @@ describe(VariantAnalysisAnalyzedRepos.name, () => {
expect(rows[5]).toHaveTextContent("octodemo/hello-world-6");
});
it("uses the results count sort key", async () => {
it("uses the 'Number of results' sort key", async () => {
render({
filterSortState: {
...defaultFilterSortState,

View File

@@ -127,7 +127,7 @@ describe(compareRepository.name, () => {
});
});
describe("when sort key is name", () => {
describe("when sort key is 'Alphabetically'", () => {
const sorter = compareRepository({
...defaultFilterSortState,
sortKey: SortKey.Name,
@@ -153,7 +153,7 @@ describe(compareRepository.name, () => {
});
});
describe("when sort key is stars", () => {
describe("when sort key is 'Popularity'", () => {
const sorter = compareRepository({
...defaultFilterSortState,
sortKey: SortKey.Stars,
@@ -199,7 +199,7 @@ describe(compareRepository.name, () => {
});
});
describe("when sort key is last updated", () => {
describe("when sort key is 'Most recent commit'", () => {
const sorter = compareRepository({
...defaultFilterSortState,
sortKey: SortKey.LastUpdated,
@@ -271,7 +271,7 @@ describe(compareWithResults.name, () => {
});
});
describe("when sort key is stars", () => {
describe("when sort key is 'Popularity'", () => {
const sorter = compareWithResults({
...defaultFilterSortState,
sortKey: SortKey.Stars,
@@ -297,7 +297,7 @@ describe(compareWithResults.name, () => {
});
});
describe("when sort key is last updated", () => {
describe("when sort key is 'Most recent commit'", () => {
const sorter = compareWithResults({
...defaultFilterSortState,
sortKey: SortKey.LastUpdated,