Skip to content

Commit

Permalink
remove tab postfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Assem-Hafez committed Sep 3, 2024
1 parent 4f050dd commit 34e54ef
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import React from 'react';

import { render } from '@/test-utils/rtl';

import WorkflowHistoryTabEventStatusBadge from '../workflow-history-tab-event-status-badge';
import WorkflowHistoryEventStatusBadge from '../workflow-history-event-status-badge';
import {
WORKFLOW_EVENT_STATUS,
WORKFLOW_EVENT_STATUS_BADGE_SIZES,
} from '../workflow-history-tab-event-status-badge.constants';
} from '../workflow-history-event-status-badge.constants';

describe('WorkflowHistoryTabEventStatusBadge', () => {
describe('WorkflowHistoryEventStatusBadge', () => {
it('should match snapshot when status is not valid and badge should not be rendered', () => {
const { container } = render(
// @ts-expect-error invalid status
<WorkflowHistoryTabEventStatusBadge status="INVALID_STATUS" />
<WorkflowHistoryEventStatusBadge status="INVALID_STATUS" />
);
expect(container).toMatchSnapshot();
});

it('should match snapshot when size is not valid and icon should not be rendered', () => {
const { container } = render(
// @ts-expect-error invalid size
<WorkflowHistoryTabEventStatusBadge status="COMPLETE" size="invalid" />
<WorkflowHistoryEventStatusBadge status="COMPLETE" size="invalid" />
);
expect(container).toMatchSnapshot();
});
Expand All @@ -29,7 +29,7 @@ describe('WorkflowHistoryTabEventStatusBadge', () => {
for (const size of Object.values(WORKFLOW_EVENT_STATUS_BADGE_SIZES)) {
it(`should match snapshot when status is ${status} and size is ${size}`, () => {
const { container } = render(
<WorkflowHistoryTabEventStatusBadge status={status} size={size} />
<WorkflowHistoryEventStatusBadge status={status} size={size} />
);
expect(container).toMatchSnapshot();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when size is not valid and icon should not be rendered 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when size is not valid and icon should not be rendered 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand All @@ -11,7 +11,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when size is n
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is COMPLETED and size is medium 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is COMPLETED and size is medium 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -44,7 +44,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is COMPLETED and size is small 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is COMPLETED and size is small 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -77,7 +77,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is FAILED and size is medium 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is FAILED and size is medium 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -113,7 +113,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is FAILED and size is small 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is FAILED and size is small 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -149,7 +149,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is ONGOING and size is medium 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is ONGOING and size is medium 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand All @@ -171,7 +171,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is ONGOING and size is small 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is ONGOING and size is small 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand All @@ -193,7 +193,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is WAITING and size is medium 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is WAITING and size is medium 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -226,7 +226,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is WAITING and size is small 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is WAITING and size is small 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down Expand Up @@ -259,7 +259,7 @@ exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is
</div>
`;

exports[`WorkflowHistoryTabEventStatusBadge should match snapshot when status is not valid and badge should not be rendered 1`] = `
exports[`WorkflowHistoryEventStatusBadge should match snapshot when status is not valid and badge should not be rendered 1`] = `
<div>
<div
class="css-cOgsKQ"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WorkflowEventStatusBadgeSize } from './workflow-history-tab-event-status-badge.types';
import type { WorkflowEventStatusBadgeSize } from './workflow-history-event-status-badge.types';

export const WORKFLOW_EVENT_STATUS = {
COMPLETED: 'COMPLETED',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import type { StyletronCSSObjectValue } from '@/hooks/use-styletron-classes';
import {
WORKFLOW_EVENT_STATUS,
containerSizeMap,
} from './workflow-history-tab-event-status-badge.constants';
} from './workflow-history-event-status-badge.constants';
import type {
Props,
WorkflowEventStatusBadgeSize,
} from './workflow-history-tab-event-status-badge.types';
} from './workflow-history-event-status-badge.types';

export const styled = {
BadgeContainer: createStyled<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
WORKFLOW_EVENT_STATUS,
WORKFLOW_EVENT_STATUS_BADGE_SIZES,
iconSizeMap,
} from './workflow-history-tab-event-status-badge.constants';
import { styled } from './workflow-history-tab-event-status-badge.styles';
import type { Props } from './workflow-history-tab-event-status-badge.types';
} from './workflow-history-event-status-badge.constants';
import { styled } from './workflow-history-event-status-badge.styles';
import type { Props } from './workflow-history-event-status-badge.types';

export default function WorkflowHistoryTabEventStatusBadge({
export default function WorkflowHistoryEventStatusBadge({
status,
size = WORKFLOW_EVENT_STATUS_BADGE_SIZES.medium,
}: Props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type WORKFLOW_EVENT_STATUS } from './workflow-history-tab-event-status-badge.constants';
import { type WORKFLOW_EVENT_STATUS } from './workflow-history-event-status-badge.constants';

export type WorkflowEventStatusBadgeSize = 'small' | 'medium';

Expand Down

0 comments on commit 34e54ef

Please sign in to comment.