Skip to content

Commit

Permalink
fix: minor bugs & tests adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Dec 13, 2024
1 parent f4bb518 commit 634ce7a
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 38 deletions.
56 changes: 29 additions & 27 deletions src/shared/components/DynamicPageComponent/DynamicPageComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,44 +328,46 @@ export const DynamicPageComponent = ({
hidePinButton={true}
titleArea={headerTitle}
headerArea={customHeaderContent ?? headerContent}
selectedSectionId={selectedSectionIdState}
onSelectedSectionChange={e => {
if (isFormOpen.formOpen) {
e.preventDefault();
}

handleActionIfFormOpen(
isResourceEdited,
setIsResourceEdited,
isFormOpen,
setIsFormOpen,
() => {
setSelectedSectionIdState(e.detail.selectedSectionId);
setIsResourceEdited({
isEdited: false,
});
},
);

if (e.detail.selectedSectionI === 'edit') {
setIsFormOpen({ formOpen: true });
}
}}
ref={dynamicPage => handlePageRef(dynamicPage)}
>
<TabContainer
className="tab-container"
style={{ top: `${headerHeight}px` }}
ref={tabContainerRef}
onTabSelect={event => {
const mode = event.detail.tab.getAttribute('data-mode');
setSelectedSectionIdState(mode);
onTabSelect={e => {
if (isFormOpen.formOpen) {
e.preventDefault();
}

handleActionIfFormOpen(
isResourceEdited,
setIsResourceEdited,
isFormOpen,
setIsFormOpen,
() => {
setSelectedSectionIdState(
e.detail.tab.getAttribute('data-mode'),
);
setIsResourceEdited({
isEdited: false,
});
},
);

if (e.detail.tab.getAttribute('data-mode') === 'edit') {
setIsFormOpen({ formOpen: true });
}
}}
>
<Tab data-mode="view" text={t('common.tabs.view')}></Tab>
<Tab
data-mode="view"
text={t('common.tabs.view')}
selected={selectedSectionIdState === 'view'}
></Tab>
<Tab
data-mode="edit"
text={showYamlTab ? t('common.tabs.yaml') : t('common.tabs.edit')}
selected={selectedSectionIdState === 'edit'}
></Tab>
</TabContainer>

Expand Down
2 changes: 2 additions & 0 deletions src/shared/components/GenericList/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const HeaderRenderer = ({
<TableColumn
slot={`${slot}-${index}`}
key={typeof h === 'object' ? index : h}
popinDisplay="Block"
demandPopin={h === 'Popin' ? true : false}
minWidth={
Array.isArray(noHideFields) && noHideFields.length !== 0
? noHideFields.find(field => field === h)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ context('Test Cluster Role Bindings', () => {
cy.clickGenericListLink(CRB_NAME);

cy.getMidColumn()
.contains('User')
.contains('ui5-table-cell', 'User')
.should('be.visible');

cy.getMidColumn()
.contains(USER_NAME)
.contains('ui5-table-cell', USER_NAME)
.should('be.visible');

cy.getMidColumn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ context('Test Custom Resources', () => {
});

it('Test column layout and remove CRD', () => {
cy.reload();
cy.getLeftNav()
.contains('Custom Resources')
.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ context('Test Kyma Modules views', () => {
.find('ui5-title', 'No modules')
.should('be.visible');

cy.get('div[data-component-name="ObjectPageHeaderContainer"]')
cy.get('div[data-component-name="DynamicPageHeaderContainer"]')
.contains('Release channel')
.should('be.visible');

cy.get('div[data-component-name="ObjectPageHeaderContainer"]')
cy.get('div[data-component-name="DynamicPageHeaderContainer"]')
.contains('regular')
.should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ context(
});

it('Check sections of namespace details', () => {
cy.contains('span', LIMIT_NAME)
cy.contains('ui5-text', LIMIT_NAME)
.scrollIntoView()
.should('be.visible');

cy.contains('Container').should('be.visible');

cy.contains('span', QUOTA_NAME)
cy.contains('ui5-text', QUOTA_NAME)
.scrollIntoView()
.should('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ context('Test Service Accounts', () => {

it('Generate TokenRequest', () => {
cy.getMidColumn()
.find('header')
.find('ui5-toggle-button:visible')
.click();

cy.get('[data-component-name="ToolbarOverflowPopoverContent"]')
.contains('ui5-button', 'Generate TokenRequest')
.click();

Expand Down

0 comments on commit 634ce7a

Please sign in to comment.