Skip to content

Commit

Permalink
Updates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Dec 17, 2024
1 parent 56600f8 commit 81feacd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exports[`traverses a schema and returns a list of env variables that match 1`] =
"GC_DATA_LAYER",
"GC_DATA_LAYER_CORE_WEB_VITALS",
"GC_DEBUG",
"GC_DEBUG_CART",
"GC_DEBUG_PLUGIN_STATUS",
"GC_DEBUG_SESSIONS",
"GC_DEBUG_WEBPACK_CIRCULAR_DEPENDENCY_PLUGIN",
Expand Down
22 changes: 16 additions & 6 deletions packagesDev/next-config/__tests__/interceptors/findPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { GraphCommerceConfig } from '../../src/generated/config'
import { findPlugins } from '../../src/interceptors/findPlugins'

const projectRoot = `${process.cwd()}/examples/magento-graphcms`
it('finds plugins', () => {
const fakeconfig = {
Expand All @@ -12,7 +13,8 @@ it('finds plugins', () => {
const disabled = plugins.filter((p) => !p.enabled)
const enabled = plugins.filter((p) => p.enabled)
expect(errors).toMatchInlineSnapshot('[]')
expect(enabled).toMatchInlineSnapshot(`
expect(enabled).toMatchInlineSnapshot(
`
[
{
"enabled": true,
Expand Down Expand Up @@ -541,9 +543,9 @@ it('finds plugins', () => {
"type": "function",
},
]
`)
expect(disabled).toMatchInlineSnapshot(
`
`,
)
expect(disabled).toMatchInlineSnapshot(`
[
{
"enabled": false,
Expand Down Expand Up @@ -716,6 +718,15 @@ it('finds plugins', () => {
"targetModule": "@graphcommerce/framer-next-pages",
"type": "component",
},
{
"enabled": false,
"ifConfig": "debug.cart",
"sourceExport": "FramerNextPages",
"sourceModule": "@graphcommerce/magento-cart/plugins/CartDebuggerPlugin",
"targetExport": "FramerNextPages",
"targetModule": "@graphcommerce/framer-next-pages",
"type": "component",
},
{
"enabled": false,
"ifConfig": "debug.sessions",
Expand All @@ -735,6 +746,5 @@ it('finds plugins', () => {
"type": "component",
},
]
`,
)
`)
})

0 comments on commit 81feacd

Please sign in to comment.