-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include
CustomViewSelector
component in page components VRTs (#3246)
* test(vrt): custom views selectors * docs: changesets --------- Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com>
- Loading branch information
1 parent
6c5a82a
commit fe0b5f7
Showing
25 changed files
with
281 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@commercetools-frontend/application-components': patch | ||
--- | ||
|
||
Missing prop |
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 @@ | ||
--- | ||
'@commercetools-local/visual-testing-app': patch | ||
--- | ||
|
||
Test Custom Views selector |
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.
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,72 @@ | ||
import { ApolloClient, InMemoryCache } from '@apollo/client'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
// @ts-ignore | ||
import FetchCustomViewsQuery from '../../packages/application-components/src/components/custom-views/custom-views-selector/fetch-custom-views-by-locator.settings.graphql'; | ||
import { CUSTOM_VIEW_LOCATORS } from './constants'; | ||
|
||
export const customView1 = { | ||
id: uuidv4(), | ||
defaultLabel: 'Avengers', | ||
labelAllLocales: [], | ||
url: 'https://avengers.app', | ||
type: 'CustomPanel', | ||
typeSettings: { | ||
size: 'LARGE', | ||
}, | ||
locators: [CUSTOM_VIEW_LOCATORS.productDetails], | ||
permissions: [ | ||
{ | ||
name: 'view', | ||
oAuthScopes: ['view_products'], | ||
}, | ||
], | ||
}; | ||
|
||
export const customView2 = { | ||
id: uuidv4(), | ||
defaultLabel: 'Justice League', | ||
labelAllLocales: [], | ||
url: 'https://justice-league.app', | ||
type: 'CustomPanel', | ||
typeSettings: { | ||
size: 'SMALL', | ||
}, | ||
locators: [CUSTOM_VIEW_LOCATORS.productDetails], | ||
permissions: [ | ||
{ | ||
name: 'view', | ||
oAuthScopes: ['view_products'], | ||
}, | ||
], | ||
}; | ||
|
||
const cache = new InMemoryCache(); | ||
cache.writeQuery({ | ||
query: FetchCustomViewsQuery, | ||
variables: { | ||
customViewLocatorCode: CUSTOM_VIEW_LOCATORS.productDetails, | ||
}, | ||
data: { | ||
allCustomViewsInstallationsByLocator: [ | ||
{ | ||
id: uuidv4(), | ||
customView: customView1, | ||
}, | ||
{ | ||
id: uuidv4(), | ||
customView: customView2, | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
const apolloClient = new ApolloClient({ | ||
cache, | ||
defaultOptions: { | ||
query: { | ||
fetchPolicy: 'cache-only', | ||
}, | ||
}, | ||
}); | ||
|
||
export default apolloClient; |
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
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
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
Oops, something went wrong.
fe0b5f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for merchant-center-application-kit ready!
✅ Preview
https://merchant-center-application-97im90lc1-commercetools.vercel.app
Built with commit fe0b5f7.
This pull request is being automatically deployed with vercel-action