Skip to content

Commit

Permalink
Fix typos and other oddities.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuasha420 committed Mar 22, 2023
1 parent 52b4745 commit 9e520a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/js/modules/analytics-4/datastore/report.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ describe( 'modules/analytics-4 report', () => {
expect( isGatheringData() ).toBe( true );
} );

it( 'should return FALSE if the connnected GA4 property is older than treww days', async () => {
it( 'should return FALSE if the connnected GA4 property is older than three days', async () => {
muteFetch(
new RegExp(
'^/google-site-kit/v1/modules/analytics-4/data/data-available'
Expand Down
12 changes: 7 additions & 5 deletions assets/js/modules/analytics/datastore/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ export const getCanUseSnippet = createRegistrySelector( ( select ) => () => {
* @return {boolean|undefined} True if the dashboard view is GA4, false if it is UA, or undefined if not loaded.
*/
export const isGA4DashboardView = createRegistrySelector( ( select ) => () => {
const isGA4Enabled = isFeatureEnabled( 'ga4Reporting' );
if ( ! isGA4Enabled ) {
const ga4ReportingEnabled = isFeatureEnabled( 'ga4Reporting' );

if ( ! ga4ReportingEnabled ) {
return false;
}

Expand All @@ -307,12 +308,13 @@ export const isGA4DashboardView = createRegistrySelector( ( select ) => () => {
*
* @since n.e.x.t
*
* @return {boolean} True if the user should be prompted to switch to GA4 Dashboard, false otherwise, or undefined if not loaded.
* @return {boolean} True if the user should be prompted to switch to the GA4 Dashboard View, false otherwise, or undefined if not loaded.
*/
export const shouldPromptGA4DashboardView = createRegistrySelector(
( select ) => () => {
const isGA4Enabled = isFeatureEnabled( 'ga4Reporting' );
if ( ! isGA4Enabled ) {
const ga4ReportingEnabled = isFeatureEnabled( 'ga4Reporting' );

if ( ! ga4ReportingEnabled ) {
return false;
}

Expand Down
6 changes: 3 additions & 3 deletions assets/js/modules/analytics/datastore/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
} from './settings';
import { CORE_MODULES } from '../../../googlesitekit/modules/datastore/constants';
import { MODULES_TAGMANAGER } from '../../tagmanager/datastore/constants';
import { enabledFeatures } from '../../../features';
import { enabledFeatures, isFeatureEnabled } from '../../../features';

describe( 'modules/analytics settings', () => {
let registry;
Expand Down Expand Up @@ -1046,8 +1046,8 @@ describe( 'modules/analytics settings', () => {

describe( 'shouldPromptGA4DashboardView', () => {
it( 'should return false when the `ga4Reporting` feature flag is not enabled', () => {
// Delete the `ga4Reporting` feature flag if it exists.
enabledFeatures.delete( 'ga4Reporting' );
// Verify the `ga4Reporting` feature flag is not enabled.
expect( isFeatureEnabled( 'ga4Reporting' ) ).toBe( false );

expect(
registry
Expand Down

0 comments on commit 9e520a2

Please sign in to comment.