File tree Expand file tree Collapse file tree 1 file changed +30
-2
lines changed
src/lightning-stubs/graphql Expand file tree Collapse file tree 1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change 44 * SPDX-License-Identifier: MIT
55 * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66 */
7- import { gql , graphql } from '../uiGraphQLApi/uiGraphQLApi' ;
7+ import { createTestWireAdapter } from '@salesforce/wire-service-jest-util' ;
8+ export class graphql extends createTestWireAdapter ( ) {
9+ static emit ( value , filterFn , refreshFn ) {
10+ super . emit (
11+ {
12+ data : value ,
13+ errors : undefined ,
14+ ...( refreshFn !== undefined && { refresh : refreshFn } ) ,
15+ } ,
16+ filterFn ,
17+ ) ;
18+ }
819
9- export { gql , graphql } ;
20+ static emitErrors ( errors , filterFn , refreshFn ) {
21+ super . emit (
22+ {
23+ data : undefined ,
24+ errors,
25+ ...( refreshFn !== undefined && { refresh : refreshFn } ) ,
26+ } ,
27+ filterFn ,
28+ ) ;
29+ }
30+
31+ constructor ( dataCallback ) {
32+ super ( dataCallback ) ;
33+
34+ graphql . emit ( undefined ) ;
35+ }
36+ }
37+ export const gql = jest . fn ( ) ;
You can’t perform that action at this time.
0 commit comments