This commit is contained in:
Ron Rennick 2021-10-06 09:59:44 -03:00 committed by GitHub
parent 5fb4fb51a9
commit 09a285cb52
3 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,7 @@
# Unreleased
- Add Customers to analytics pages tested #7573
# 0.1.1
- Allow packages to be built in isolation. #7286

View File

@ -0,0 +1,9 @@
/**
* Internal dependencies
*/
import { Analytics } from './Analytics';
export class Customers extends Analytics {
// The analytics pages are `analytics-{slug}`.
url = 'wp-admin/admin.php?page=wc-admin&path=%2Fcustomers';
}

View File

@ -2,6 +2,7 @@
* Internal dependencies
*/
import { Analytics } from '../../pages/Analytics';
import { Customers } from '../../pages/Customers';
import { Login } from '../../pages/Login';
/* eslint-disable @typescript-eslint/no-var-requires */
@ -10,6 +11,7 @@ const { afterAll, beforeAll, describe, it } = require( '@jest/globals' );
const testAdminAnalyticsPages = () => {
describe( 'Analytics pages', () => {
const analyticsPage = new Analytics( page );
const customersPage = new Customers( page );
const login = new Login( page );
beforeAll( async () => {
@ -73,6 +75,11 @@ const testAdminAnalyticsPages = () => {
await analyticsPage.navigateToSection( 'settings' );
await analyticsPage.isDisplayed();
} );
it( 'A user can view the customers page without it crashing', async () => {
await customersPage.navigate();
await customersPage.isDisplayed();
} );
} );
};