Skip to content

Commit

Permalink
fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
matejnesuta committed Jun 25, 2024
1 parent 95a0afc commit cd5f9b2
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions plugins/kiali/src/components/About/AboutUIModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@ export const AboutUIModal = (props: AboutUIModalProps) => {
<Grid item xs={4}>
Kiali
</Grid>
<Grid item xs={8} data-test={'Kiali'}>
<Grid item xs={8} data-test="Kiali">
{coreVersion || 'Unknown'}
</Grid>
<Grid item xs={4}>
Kiali Container
</Grid>
<Grid item xs={8} data-test={'Kiali container'}>
<Grid item xs={8} data-test="Kiali container">
{containerVersion || 'Unknown'}
</Grid>
<Grid item xs={4}>
Service Mesh
</Grid>
<Grid item xs={8} data-test={'Service Mesh'}>
<Grid item xs={8} data-test="Service Mesh">
{meshVersion || 'Unknown'}
</Grid>
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions plugins/kiali/src/components/MessageCenter/AlertDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const noNotificationsMessage = (

export const AlertDrawer = (props: AlertDrawerProps) => {
return (
<Card className={drawer} data-test={'message-center-modal'}>
<Card className={drawer} data-test="message-center-modal">
<CardMedia>
<ItemCardHeader title="MessageCenter" subtitle="" />
</CardMedia>
Expand All @@ -74,7 +74,7 @@ export const AlertDrawer = (props: AlertDrawerProps) => {
<AccordionSummary
key={`${group.id}_item`}
expandIcon={<ExpandMoreRounded />}
data-test={'message-center-summary'}
data-test="message-center-summary"
>
<Typography>
{group.title} {getUnreadMessageLabel(group.messages)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const AlertDrawerGroup = (props: AlertDrawerGroupProps) => {
<Card elevation={0}>
<CardContent
style={{ paddingTop: 0 }}
data-test={'message-center-messages'}
data-test="message-center-messages"
>
{group.messages.length === 0 && noNotificationsMessage}
{getMessages().map(message => (
Expand All @@ -71,14 +71,14 @@ export const AlertDrawerGroup = (props: AlertDrawerGroupProps) => {
{group.showActions && group.messages.length > 0 && (
<CardActions>
<Button
data-test={'mark-as-read'}
data-test="mark-as-read"
variant="text"
onClick={() => markGroupAsRead(group.id)}
>
Mark All Read
</Button>
<Button
data-test={'clear-all'}
data-test="clear-all"
variant="text"
onClick={() => clearGroup(group.id)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const AlertDrawerMessage = (props: AlertDrawerMessageProps) => {

return (
<Card>
<CardContent data-test={'drawer-message'}>
<CardContent data-test="drawer-message">
{getIcon(props.message.type)}{' '}
{props.message.seen ? (
props.message.content
Expand All @@ -70,7 +70,7 @@ export const AlertDrawerMessage = (props: AlertDrawerMessageProps) => {
{props.message.showDetail ? 'Hide Detail' : 'Show Detail'}
</Typography>
</AccordionSummary>
<AccordionDetails data-test={'message-detail'}>
<AccordionDetails data-test="message-detail">
<pre style={{ whiteSpace: 'pre-wrap' }}>
{props.message.detail}
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const MessageCenter = (props: { color?: string }) => {
<Button
onClick={() => toggleDrawer(true)}
style={{ marginTop: '-15px' }}
data-test={'message-center'}
data-test="message-center"
>
<Badge
overlap="circular"
Expand Down
2 changes: 1 addition & 1 deletion plugins/kiali/src/pages/Kiali/Header/HelpKiali.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const HelpKiali = (props: { color?: string }) => {
<Button
onClick={openAbout}
style={{ marginTop: '-5px' }}
data-test={'help-button'}
data-test="help-button"
>
<QuestionCircleIcon color={`${props.color}`} />
</Button>
Expand Down
4 changes: 2 additions & 2 deletions plugins/kiali/src/pages/Kiali/Header/KialiHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const KialiHeader = () => {
color="primary"
icon={<ClusterIcon />}
label={homeCluster?.name}
data-test={'home-cluster'}
data-test="home-cluster"
/>
</Tooltip>
<HelpKiali />
Expand All @@ -36,7 +36,7 @@ export const KialiHeader = () => {
flexDirection: 'row',
justifyContent: 'space-between',
}}
data-test={'user'}
data-test="user"
>
<span style={{ margin: '10px' }}>
<b>User : </b>
Expand Down
2 changes: 1 addition & 1 deletion plugins/kiali/src/pages/Kiali/Header/NamespaceSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const NamespaceSelector = (props: { page?: boolean }) => {
onChange={handleChange}
renderValue={selected => (selected as string[]).join(', ')}
MenuProps={MenuProps}
data-test={'namespace-selector'}
data-test="namespace-selector"
>
{(kialiState.namespaces.items || []).map(ns => (
<MenuItem key={ns.name} value={ns.name}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const NamespaceLabels = (props: NamespaceLabelsprops) => {
? `${Object.entries(props.labels).length}`
: 'No';
const tooltipTitle = (
<ul data-test={'namespace-labels'}>
<ul data-test="namespace-labels">
{Object.entries(props.labels || []).map(([key, value]) => (
<li key={key}>
{key}={value}
Expand All @@ -27,7 +27,7 @@ export const NamespaceLabels = (props: NamespaceLabelsprops) => {
{labelsLength} label{labelsLength !== '1' ? 's' : ''}
</div>
<Tooltip title={tooltipTitle} placement="right">
<span data-test={'labels-info-icon'}>
<span data-test="labels-info-icon">
<KialiIcon.Info className={infoStyle} />
</span>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const OverviewCard = (props: OverviewCardProps) => {
errors={validations.errors}
warnings={validations.warnings}
objectCount={validations.objectCount}
data-test={'validation-summary'}
data-test="validation-summary"
/>
);
};
Expand Down
2 changes: 1 addition & 1 deletion plugins/kiali/src/pages/Overview/OverviewStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class OverviewStatus extends React.Component<Props, {}> {
items.push(`and ${length - items.length} more...`);
}
const tooltipContent = (
<div data-test={'overview-status'}>
<div data-test="overview-status">
<strong data-test={`${this.props.status.name}-status`}>
{this.props.status.name}
</strong>
Expand Down
8 changes: 4 additions & 4 deletions plugins/kiali/tests/kialiPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ async function checkReportedItems(

const icon = await ns_card.locator('data-test=overview-app-health');
await icon.hover();
let list = await page.locator('data-test=overview-status');
const list = await page.locator('data-test=overview-status');

// Wait for the list to appear
await page.waitForSelector('data-test=overview-status');

let i = 0;
for (const object of Object.entries(objects)) {
if (i == 5) {
if (i === 5) {
break;
}
await icon.hover({ force: true }).then(async () => {
await expect(list).toContainText(`${object[1].name}`);
});
i++;
}
let expected = type == 'app' ? 'application' : type;
const expected = type === 'app' ? 'application' : type;
await expect(
ns_card.locator(`data-test=overview-type-${type}`),
).toContainText(`${Object.entries(objects).length} ${expected}s`);
Expand Down Expand Up @@ -201,7 +201,7 @@ test.describe('Kiali page', () => {
const ns_card = await page.locator(`data-test=overview-card-${ns.name}`);
const icon = await ns_card.locator('data-test=labels-info-icon');
await icon.hover();
let list = await page.locator('data-test=namespace-labels');
const list = await page.locator('data-test=namespace-labels');

// Wait for the list to appear
await page.waitForSelector('data-test=namespace-labels');
Expand Down

0 comments on commit cd5f9b2

Please sign in to comment.