Update wording in the "sorting dropdown" of the variant analysis results view (#2373)
This commit is contained in:
@@ -258,10 +258,10 @@ This requires running a MRVA query and seeing the results view.
|
|||||||
2. When the file does not exist
|
2. When the file does not exist
|
||||||
7. Can open query text
|
7. Can open query text
|
||||||
8. Can sort repos
|
8. Can sort repos
|
||||||
1. By name
|
1. Alphabetically
|
||||||
2. By results
|
2. By number of results
|
||||||
3. By stars
|
3. By popularity
|
||||||
4. By last updated
|
4. By most recent commit
|
||||||
9. Can filter repos
|
9. Can filter repos
|
||||||
10. Shows correct statistics
|
10. Shows correct statistics
|
||||||
1. Total number of results
|
1. Total number of results
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const LastUpdated = ({ lastUpdated }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<IconContainer>
|
<IconContainer>
|
||||||
<Codicon name="repo-push" label="Last updated" />
|
<Codicon name="repo-push" label="Most recent commit" />
|
||||||
</IconContainer>
|
</IconContainer>
|
||||||
<Duration>{humanizeRelativeTime(date.getTime() - Date.now())}</Duration>
|
<Duration>{humanizeRelativeTime(date.getTime() - Date.now())}</Duration>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,10 +29,14 @@ export const RepositoriesSort = ({ value, onChange, className }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<Dropdown value={value} onInput={handleInput} className={className}>
|
<Dropdown value={value} onInput={handleInput} className={className}>
|
||||||
<Codicon name="sort-precedence" label="Sort..." slot="indicator" />
|
<Codicon name="sort-precedence" label="Sort..." slot="indicator" />
|
||||||
<VSCodeOption value={SortKey.Name}>Name</VSCodeOption>
|
<VSCodeOption value={SortKey.Name}>Alphabetically</VSCodeOption>
|
||||||
<VSCodeOption value={SortKey.ResultsCount}>Results</VSCodeOption>
|
<VSCodeOption value={SortKey.ResultsCount}>
|
||||||
<VSCodeOption value={SortKey.Stars}>Stars</VSCodeOption>
|
Number of results
|
||||||
<VSCodeOption value={SortKey.LastUpdated}>Last updated</VSCodeOption>
|
</VSCodeOption>
|
||||||
|
<VSCodeOption value={SortKey.Stars}>Popularity</VSCodeOption>
|
||||||
|
<VSCodeOption value={SortKey.LastUpdated}>
|
||||||
|
Most recent commit
|
||||||
|
</VSCodeOption>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe(RepoRow.name, () => {
|
|||||||
screen.queryByRole("img", {
|
screen.queryByRole("img", {
|
||||||
// There should not be any icons, except for the icons which are always shown
|
// There should not be any icons, except for the icons which are always shown
|
||||||
name: (name) =>
|
name: (name) =>
|
||||||
!["expand", "stars count", "last updated"].includes(
|
!["expand", "stars count", "most recent commit"].includes(
|
||||||
name.toLowerCase(),
|
name.toLowerCase(),
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
@@ -293,7 +293,7 @@ describe(RepoRow.name, () => {
|
|||||||
expect(screen.getByText("last month")).toBeInTheDocument();
|
expect(screen.getByText("last month")).toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
screen.getByRole("img", {
|
screen.getByRole("img", {
|
||||||
name: "Last updated",
|
name: "Most recent commit",
|
||||||
}),
|
}),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
@@ -314,7 +314,7 @@ describe(RepoRow.name, () => {
|
|||||||
).not.toBeInTheDocument();
|
).not.toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
screen.queryByRole("img", {
|
screen.queryByRole("img", {
|
||||||
name: "Last updated",
|
name: "Most recent commit",
|
||||||
}),
|
}),
|
||||||
).not.toBeInTheDocument();
|
).not.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ describe(VariantAnalysisAnalyzedRepos.name, () => {
|
|||||||
expect(rows[5]).toHaveTextContent("octodemo/hello-world-6");
|
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({
|
render({
|
||||||
filterSortState: {
|
filterSortState: {
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ describe(compareRepository.name, () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("when sort key is name", () => {
|
describe("when sort key is 'Alphabetically'", () => {
|
||||||
const sorter = compareRepository({
|
const sorter = compareRepository({
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
sortKey: SortKey.Name,
|
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({
|
const sorter = compareRepository({
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
sortKey: SortKey.Stars,
|
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({
|
const sorter = compareRepository({
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
sortKey: SortKey.LastUpdated,
|
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({
|
const sorter = compareWithResults({
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
sortKey: SortKey.Stars,
|
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({
|
const sorter = compareWithResults({
|
||||||
...defaultFilterSortState,
|
...defaultFilterSortState,
|
||||||
sortKey: SortKey.LastUpdated,
|
sortKey: SortKey.LastUpdated,
|
||||||
|
|||||||
Reference in New Issue
Block a user