Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
wpalani committed Jul 24, 2024
1 parent beb3e16 commit b026e5d
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "WordPress/WordPress#tags/6.6.1",
"core": "WordPress/WordPress#tags/6.6",
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
Expand Down
9 changes: 9 additions & 0 deletions assets/svg/transformStore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/app/pages/pages-and-posts/TransformStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Button, Card, Title } from '@newfold/ui-component-library';
import { ReactComponent as TransformLogo } from '../../../../assets/svg/transformStore.svg';

const TransformStore = () => {
return (
<Card
className="wppbh-app-transform nfd-border-0 nfd-border-t md:nfd-border-t-0 nfd-shadow-none hover:nfd-bg-[#F2F9FE]"
style={ {
borderRadius: 0,
} }
>
<Card.Content>
<TransformLogo />
<Title size="4" className="nfd-leading-normal nfd-my-4">
{ __( 'Transform your store!', 'wp-plugin-bluehost' ) }
</Title>
<p>
{ __(
'Our eCommerce bundle includes a comprehensive suite of advanced tools designed to boost the performance of your WooCommerce store.',
'wp-plugin-bluehost'
) }
</p>
</Card.Content>
<div className="nfd-flex nfd-justify-end nfd-gap-6 nfd-items-center">
<a href="admin.php?page=bluehost#/marketplace/product/6049dddb-1303-4c41-b3c0-242881697860">
<Button variant="secondary">
{ __( 'Learn More', 'wp-plugin-bluehost' ) }
</Button>
</a>
</div>
</Card>
);
};

export default TransformStore;
9 changes: 6 additions & 3 deletions src/app/pages/pages-and-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BlogPosts from './blogPosts';
import BookingAndAppointments from './bookingAndAppointments';
import ProductsPages from './ProductsPages';
import AppStore from '../../data/store';
import TransformStore from './TransformStore';

const PagesAndPosts = () => {
const { store } = useContext( AppStore );
Expand Down Expand Up @@ -78,9 +79,11 @@ const PagesAndPosts = () => {
<ProductsPages />
) }
{ window.NewfoldRuntime.isYithBookingActive &&
window.NewfoldRuntime.isWoocommerceActive && (
<BookingAndAppointments />
) }
window.NewfoldRuntime.isWoocommerceActive ? (
<BookingAndAppointments />
) : (
<TransformStore />
) }
</div>
</Container>
</Page>
Expand Down
141 changes: 77 additions & 64 deletions tests/cypress/integration/pages-and-posts.cy.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
describe( 'Pages & Posts', function () {
describe('Pages & Posts', function () {
let NewfoldRuntime;

before( () => {
before(() => {
cy.visit(
'/wp-admin/admin.php?page=' +
Cypress.env( 'pluginId' ) +
'#/pages-and-posts'
Cypress.env('pluginId') +
'#/pages-and-posts'
);
cy.window()
.its( 'NewfoldRuntime' )
.then( ( data ) => {
.its('NewfoldRuntime')
.then((data) => {
NewfoldRuntime = data;
} );
});
cy.injectAxe();
} );
});

it( 'Pages & Posts Exists', () => {
cy.get( '.wppbh-app-pagesAndPosts-page' )
.contains( 'Pages & Posts' )
it('Pages & Posts Exists', () => {
cy.get('.wppbh-app-pagesAndPosts-page')
.contains('Pages & Posts')
.scrollIntoView()
.should( 'be.visible' );
} );
.should('be.visible');
});

it( 'site pages Exists', () => {
cy.get( '.wppbh-app-site-page' )
.findByText( 'Site Pages' )
.should( 'exist' );
cy.get( '.wppbh-app-site-page' )
.find( 'a[href="edit.php?post_type=page"]' )
it('site pages Exists', () => {
cy.get('.wppbh-app-site-page')
.findByText('Site Pages')
.should('exist');
cy.get('.wppbh-app-site-page')
.find('a[href="edit.php?post_type=page"]')
.click();
cy.url().should( 'include', 'edit.php?post_type=page' );
cy.go( 'back' );
cy.url().should('include', 'edit.php?post_type=page');
cy.go('back');

cy.get( '.wppbh-app-site-page' )
.find( 'a[href="post-new.php?post_type=page"] Button' )
cy.get('.wppbh-app-site-page')
.find('a[href="post-new.php?post_type=page"] Button')
.click();
cy.url().should( 'include', 'post-new.php?post_type=page' );
cy.go( 'back' );
} );
cy.url().should('include', 'post-new.php?post_type=page');
cy.go('back');
});

it( 'Blog posts Exists', () => {
cy.get( '.wppbh-app-blog-posts' )
.findByText( 'Blog Posts' )
.should( 'exist' );
cy.get( '.wppbh-app-blog-posts' ).find( 'a[href="edit.php"]' ).click();
cy.url().should( 'include', 'edit.php' );
cy.go( 'back' );
it('Blog posts Exists', () => {
cy.get('.wppbh-app-blog-posts')
.findByText('Blog Posts')
.should('exist');
cy.get('.wppbh-app-blog-posts').find('a[href="edit.php"]').click();
cy.url().should('include', 'edit.php');
cy.go('back');

cy.get( '.wppbh-app-blog-posts' )
.get( 'a[href="post-new.php"] Button' )
cy.get('.wppbh-app-blog-posts')
.get('a[href="post-new.php"] Button')
.click();
cy.url().should( 'include', 'post-new.php' );
cy.go( 'back' );
} );
cy.url().should('include', 'post-new.php');
cy.go('back');
});

it( 'Bookings & Appointments Exists', () => {
it('Bookings & Appointments Exists', () => {
if (
NewfoldRuntime.isYithBookingActive &&
NewfoldRuntime.isWoocommerceActive
) {
cy.get( '.wppbh-app-bookings' )
.findByText( 'Bookings & Appointments' )
.should( 'exist' );
cy.get( '.wppbh-app-bookings' )
cy.get('.wppbh-app-bookings')
.findByText('Bookings & Appointments')
.should('exist');
cy.get('.wppbh-app-bookings')
.find(
'a[href="edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1"]'
)
Expand All @@ -72,9 +72,9 @@ describe( 'Pages & Posts', function () {
'include',
'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1'
);
cy.go( 'back' );
cy.go('back');

cy.get( '.wppbh-app-bookings' )
cy.get('.wppbh-app-bookings')
.find(
'a[href="edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1"] Button'
)
Expand All @@ -84,30 +84,43 @@ describe( 'Pages & Posts', function () {
'include',
'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1'
);
cy.go( 'back' );
cy.go('back');
} else {
cy.findByText( 'Bookings & Appointments' ).should( 'not.exist' );
cy.get('.wppbh-app-transform')
.findByText('Transform your store!')
.should('exist');
cy.get('.wppbh-app-transform')
.find(
'a[href="admin.php?page=bluehost#/marketplace/product/6049dddb-1303-4c41-b3c0-242881697860"]'
)
.first()
.click();
cy.url().should(
'include',
'admin.php?page=bluehost#/marketplace/product/6049dddb-1303-4c41-b3c0-242881697860'
);
cy.go('back');
}
} );
});

it( 'Products Exists', () => {
if ( NewfoldRuntime.isWoocommerceActive ) {
cy.get( '.wppbh-app-products' )
.findByText( 'Products' )
.should( 'exist' );
cy.get( '.wppbh-app-products' )
.find( 'a[href="edit.php?post_type=product"]' )
it('Products Exists', () => {
if (NewfoldRuntime.isWoocommerceActive) {
cy.get('.wppbh-app-products')
.findByText('Products')
.should('exist');
cy.get('.wppbh-app-products')
.find('a[href="edit.php?post_type=product"]')
.click();
cy.url().should( 'include', 'edit.php?post_type=product' );
cy.go( 'back' );
cy.url().should('include', 'edit.php?post_type=product');
cy.go('back');

cy.get( '.wppbh-app-products' )
.find( 'a[href="post-new.php?post_type=product"] Button' )
cy.get('.wppbh-app-products')
.find('a[href="post-new.php?post_type=product"] Button')
.click();
cy.url().should( 'include', 'post-new.php?post_type=product' );
cy.go( 'back' );
cy.url().should('include', 'post-new.php?post_type=product');
cy.go('back');
} else {
cy.findByText( 'Products' ).should( 'not.exist' );
cy.findByText('Products').should('not.exist');
}
} );
} );
});
});

0 comments on commit b026e5d

Please sign in to comment.