2021-12-12 14:56:12 -08:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2021-12-13 15:37:01 -08:00
|
|
|
import * as icons from './icons';
|
|
|
|
import './colors.css';
|
|
|
|
import './common.css';
|
2021-12-12 14:56:12 -08:00
|
|
|
|
2022-08-02 12:55:43 -07:00
|
|
|
export function statusIcon(status: 'failed' | 'timedOut' | 'skipped' | 'passed' | 'expected' | 'unexpected' | 'flaky' | 'interrupted'): JSX.Element {
|
2021-12-12 14:56:12 -08:00
|
|
|
switch (status) {
|
|
|
|
case 'failed':
|
|
|
|
case 'unexpected':
|
2021-12-13 15:37:01 -08:00
|
|
|
return icons.cross();
|
2021-12-12 14:56:12 -08:00
|
|
|
case 'passed':
|
|
|
|
case 'expected':
|
2021-12-13 15:37:01 -08:00
|
|
|
return icons.check();
|
2021-12-12 14:56:12 -08:00
|
|
|
case 'timedOut':
|
2021-12-13 15:37:01 -08:00
|
|
|
return icons.clock();
|
2021-12-12 14:56:12 -08:00
|
|
|
case 'flaky':
|
2021-12-13 15:37:01 -08:00
|
|
|
return icons.warning();
|
2021-12-12 14:56:12 -08:00
|
|
|
case 'skipped':
|
2022-08-02 12:55:43 -07:00
|
|
|
case 'interrupted':
|
2021-12-13 15:37:01 -08:00
|
|
|
return icons.blank();
|
2021-12-12 14:56:12 -08:00
|
|
|
}
|
|
|
|
}
|