-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add/protect-waf-phase-2' into update/jetpack-waf-settin…
…gs-ui
- Loading branch information
Showing
64 changed files
with
825 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
projects/github-actions/repo-gardening/changelog/change-pull-request-template-headings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: changed | ||
|
||
Changed headings in the `PULL_REQUEST_TEMPLATE` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Config: Metro JS cannot resolve `./src/index.sj` without adding the path as the `main` property in package.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
projects/js-packages/connection/changelog/fix-react-native-build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Connection: Metro JS is unable to build the component SCSS files. Adding a native index file to only export the modules required for the mobile editor build. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as useConnection } from './components/use-connection'; |
4 changes: 4 additions & 0 deletions
4
projects/js-packages/image-guide/changelog/fix-image-guide-prepare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: added | ||
|
||
Fixed an issue that would break the release process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/packages/backup/changelog/add-backup-package-js-tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: added | ||
|
||
Setup js tests and add some tests to existing reducers, selectors and hooks |
5 changes: 5 additions & 0 deletions
5
projects/packages/backup/changelog/fix-packages-backup-package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: fixed | ||
Comment: Fix JS deps added in #28130. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
projects/packages/backup/src/js/hooks/test/useBackupsState.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { renderHook } from '@testing-library/react-hooks'; | ||
import apiFetch from '@wordpress/api-fetch'; | ||
import { BACKUP_STATE } from '../../constants'; | ||
import useBackupState from '../useBackupsState'; | ||
|
||
const fixtures = { | ||
no_backups: [], | ||
no_backups_retry: [ | ||
{ | ||
id: 123456, | ||
started: '2023-01-01 02:16:32', | ||
last_updated: '2023-01-01 02:16:34', | ||
status: 'error-will-retry', | ||
period: 1672530000, | ||
percent: 0, | ||
is_backup: 1, | ||
is_scan: 0, | ||
}, | ||
], | ||
complete: [ | ||
{ | ||
id: 381971090, | ||
started: '2023-01-01 02:16:32', | ||
last_updated: '2023-01-01 02:16:34', | ||
status: 'finished', | ||
period: 1672530000, | ||
percent: 100, | ||
is_backup: 1, | ||
is_scan: 0, | ||
has_warnings: false, | ||
stats: { | ||
prefix: 'wp_', | ||
plugins: { count: 100 }, | ||
themes: { count: 100 }, | ||
uploads: { count: 100 }, | ||
tables: { | ||
wp_posts: { | ||
post_published: 100, | ||
}, | ||
}, | ||
}, // full stats details are not required currently | ||
}, | ||
], | ||
no_good_backups: [ | ||
{ | ||
id: 123456, | ||
started: '2023-01-01 02:16:32', | ||
last_updated: '2023-01-01 02:16:34', | ||
status: 'finished', | ||
period: 1672530000, | ||
percent: 0, | ||
is_backup: 1, | ||
is_scan: 0, | ||
}, | ||
], | ||
}; | ||
|
||
jest.mock( '@wordpress/api-fetch' ); | ||
|
||
describe( 'useBackupsState', () => { | ||
it( 'backupState should be NO_BACKUPS when the site has no backups', async () => { | ||
apiFetch.mockReturnValue( Promise.resolve( fixtures.no_backups ) ); | ||
const { result, waitForNextUpdate } = renderHook( () => useBackupState() ); | ||
|
||
await waitForNextUpdate(); | ||
expect( result.current.backupState ).toBe( BACKUP_STATE.NO_BACKUPS ); | ||
} ); | ||
|
||
it( 'backupState should be NO_BACKUPS_RETRY when last backup has a retry state', async () => { | ||
apiFetch.mockReturnValue( Promise.resolve( fixtures.no_backups_retry ) ); | ||
const { result, waitForNextUpdate } = renderHook( () => useBackupState() ); | ||
|
||
await waitForNextUpdate(); | ||
expect( result.current.backupState ).toBe( BACKUP_STATE.NO_BACKUPS_RETRY ); | ||
} ); | ||
|
||
it( 'backupState should be COMPLETE when last backup has finished successfully', async () => { | ||
apiFetch.mockReturnValue( Promise.resolve( fixtures.complete ) ); | ||
const { result, waitForNextUpdate } = renderHook( () => useBackupState() ); | ||
|
||
await waitForNextUpdate(); | ||
expect( result.current.backupState ).toBe( BACKUP_STATE.COMPLETE ); | ||
} ); | ||
|
||
it( 'backupState should be NO_GOOD_BACKUPS when last backup finished with no stats', async () => { | ||
apiFetch.mockReturnValue( Promise.resolve( fixtures.no_good_backups ) ); | ||
const { result, waitForNextUpdate } = renderHook( () => useBackupState() ); | ||
|
||
await waitForNextUpdate(); | ||
expect( result.current.backupState ).toBe( BACKUP_STATE.NO_GOOD_BACKUPS ); | ||
} ); | ||
|
||
it( 'backupState should be NO_GOOD_BACKUPS when fetch backups API call fails', async () => { | ||
apiFetch.mockReturnValue( Promise.reject( 'any error' ) ); | ||
const { result, waitForNextUpdate } = renderHook( () => useBackupState() ); | ||
|
||
await waitForNextUpdate(); | ||
expect( result.current.backupState ).toBe( BACKUP_STATE.NO_GOOD_BACKUPS ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import API from '../api'; | ||
|
||
describe( 'reducer', () => { | ||
describe( 'API', () => { | ||
test( 'should return the initial state when undefined state is passed', () => { | ||
expect( API( undefined, {} ) ).toEqual( {} ); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import assets from '../assets'; | ||
|
||
describe( 'reducer', () => { | ||
describe( 'assets', () => { | ||
test( 'should return the initial state when undefined state is passed', () => { | ||
expect( assets( undefined, {} ) ).toEqual( {} ); | ||
} ); | ||
} ); | ||
} ); |
9 changes: 9 additions & 0 deletions
9
projects/packages/backup/src/js/reducers/test/connected-plugins.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import connectedPlugins from '../connected-plugins'; | ||
|
||
describe( 'reducer', () => { | ||
describe( 'connectedPlugins', () => { | ||
test( 'should return the initial state when undefined state is passed', () => { | ||
expect( connectedPlugins( undefined, {} ) ).toEqual( {} ); | ||
} ); | ||
} ); | ||
} ); |
9 changes: 9 additions & 0 deletions
9
projects/packages/backup/src/js/reducers/test/jetpack-status.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import jetpackStatus from '../jetpack-status'; | ||
|
||
describe( 'reducer', () => { | ||
describe( 'jetpackStatus', () => { | ||
test( 'should return the initial state when undefined state is passed', () => { | ||
expect( jetpackStatus( undefined, {} ) ).toEqual( {} ); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import siteData from '../site-data'; | ||
|
||
describe( 'reducer', () => { | ||
describe( 'siteData', () => { | ||
test( 'should return the initial state when undefined state is passed', () => { | ||
expect( siteData( undefined, {} ) ).toEqual( {} ); | ||
} ); | ||
} ); | ||
} ); |
Oops, something went wrong.