-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(ui-mode): enhance status-line to show passed, failed, and skipped test counts #35859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pengooseDev
wants to merge
8
commits into
microsoft:main
Choose a base branch
from
pengooseDev:feat-skipped-test-report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3589e06
feat: add test result UI
pengooseDev e9a2642
test: update regression tests
pengooseDev 863cbb1
feat: add statusLine
pengooseDev 6356c06
test: update regression test
pengooseDev e5e85e0
chore: add status ellipsis
pengooseDev 9608c92
chore: use margin-left per FiltersView
pengooseDev f3b3209
chore: adjust status-line cursor(pointer > default)
pengooseDev 84fc89c
chore: simplify rendering logic for statusline
pengooseDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
.status-line { | ||
display: block; | ||
width: 100%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
line-height: 30px; | ||
height: 30px; | ||
margin-left: 5px; | ||
cursor: default; | ||
} | ||
|
||
.status-line > span:not(:first-child) { | ||
display: inline-flex; | ||
align-items: center; | ||
gap: 4px; | ||
user-select: none; | ||
margin-left: 8px; | ||
} | ||
|
||
.status-line-count { | ||
display: inline-flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
.status-passed { | ||
color: var(--vscode-debugIcon-restartForeground); | ||
} | ||
|
||
.status-failed { | ||
color: var(--vscode-list-errorForeground); | ||
} | ||
|
||
.status-skipped { | ||
color: var(--vscode-foreground); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import '@web/third_party/vscode/codicon.css'; | ||
import '@web/common.css'; | ||
import './statusLine.css'; | ||
import React from 'react'; | ||
import { clsx } from '@web/uiUtils'; | ||
import { testStatusIcon } from './testUtils'; | ||
|
||
interface StatusLineProps { | ||
passed: number; | ||
failed: number; | ||
skipped: number; | ||
total: number; | ||
isRunning: boolean; | ||
} | ||
|
||
export const StatusLine: React.FC<StatusLineProps> = ({ passed, failed, skipped, total, isRunning }) => { | ||
const count = passed + failed + skipped; | ||
return ( | ||
<div data-testid='status-line' className='status-line' title={`${passed} passed, ${failed} failed, ${skipped} skipped`}> | ||
<span className='status-line-count'> | ||
<i className={clsx('codicon', isRunning ? testStatusIcon('running') : testStatusIcon('none'))} /> | ||
<span data-testid='test-count'>{count}/{total}</span> | ||
</span> | ||
<span className='status-passed'> | ||
<i className={clsx('codicon', testStatusIcon('passed'))} />{passed || 0} | ||
</span> | ||
<span className='status-failed'> | ||
<i className={clsx('codicon', testStatusIcon('failed'))} />{failed || 0} | ||
</span> | ||
<span className='status-skipped'> | ||
<i className={clsx('codicon', testStatusIcon('skipped'))} />{skipped || 0} | ||
</span> | ||
</div> | ||
); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
display: flex
withalign-items: center
. You'll have to fix some other things, but as it is the ellipsis is misaligned from the text baseline as it's not currently vertically centered.