Skip to content

Commit

Permalink
🧪 test(packages): update inline snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
xcfox committed Nov 19, 2024
1 parent 2694a12 commit 5d9213d
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 127 deletions.
102 changes: 63 additions & 39 deletions packages/prisma/test/bobbin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Query {
"type User {
id: ID!
email: String!
name: String
}
type Query {
countUser(where: UserWhereInput!): Int!
}
Expand Down Expand Up @@ -265,16 +271,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Query {
findFirstUser(where: UserWhereInput): User
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Query {
findFirstUser(where: UserWhereInput): User
}
input UserWhereInput {
name: String!
}"
Expand Down Expand Up @@ -323,16 +329,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Query {
findManyUser(where: UserWhereInput): [User!]!
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Query {
findManyUser(where: UserWhereInput): [User!]!
}
input UserWhereInput {
name: String!
}"
Expand Down Expand Up @@ -381,16 +387,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Query {
findUniqueUser(where: UserWhereInput!): User
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Query {
findUniqueUser(where: UserWhereInput!): User
}
input UserWhereInput {
id: Float!
}"
Expand Down Expand Up @@ -439,16 +445,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
createUser(data: UserCreateInput!): User
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
createUser(data: UserCreateInput!): User
}
input UserCreateInput {
email: String!
}"
Expand Down Expand Up @@ -494,7 +500,13 @@ describe("PrismaModelBobbin", () => {
})
const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
createManyUser(data: [UserCreateManyInput!]!): BatchPayload
}
Expand Down Expand Up @@ -549,16 +561,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
deleteUser(where: UserDeleteInput!): User
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
deleteUser(where: UserDeleteInput!): User
}
input UserDeleteInput {
email: String!
}"
Expand Down Expand Up @@ -605,7 +617,13 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
deleteManyUser(where: UserDeleteManyInput!): BatchPayload
}
Expand Down Expand Up @@ -666,16 +684,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
updateUser(data: UserUpdateInput!, where: UserWhereInput!): User!
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
updateUser(data: UserUpdateInput!, where: UserWhereInput!): User!
}
input UserUpdateInput {
email: String!
}
Expand Down Expand Up @@ -733,7 +751,13 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
updateManyUser(data: UserUpdateManyInput!, where: UserWhereInput!): BatchPayload
}
Expand Down Expand Up @@ -799,16 +823,16 @@ describe("PrismaModelBobbin", () => {

const schema = weave(r)
expect(printSchema(schema)).toMatchInlineSnapshot(`
"type Mutation {
upsertUser(where: UserWhereUniqueInput!, create: UserUpsertInput!, update: UserUpsertInput!): User!
}
type User {
"type User {
id: ID!
email: String!
name: String
}
type Mutation {
upsertUser(where: UserWhereUniqueInput!, create: UserUpsertInput!, update: UserUpsertInput!): User!
}
input UserWhereUniqueInput {
email: String!
}
Expand Down
80 changes: 40 additions & 40 deletions packages/valibot/test/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ describe("", () => {
})

expect(printResolver(r)).toMatchInlineSnapshot(`
"type Query {
dog: Dog!
"type Dog {
name: String
}
type Dog {
name: String
type Query {
dog: Dog!
}"
`)
})
Expand Down Expand Up @@ -348,11 +348,7 @@ describe("", () => {
})

expect(printResolver(r)).toMatchInlineSnapshot(`
"type Query {
orange: Orange!
}
type Orange implements Fruit {
"type Orange implements Fruit {
name: String!
color: String!
prize: Float!
Expand All @@ -362,6 +358,10 @@ describe("", () => {
name: String!
color: String!
prize: Float!
}
type Query {
orange: Orange!
}"
`)
})
Expand Down Expand Up @@ -482,15 +482,15 @@ describe("", () => {
}),
})
expect(printResolver(r1, r2)).toMatchInlineSnapshot(`
"type Query {
dog: Dog!
}
type Dog {
"type Dog {
name: String!
birthday: String!
age: Float!
greeting: String!
}
type Query {
dog: Dog!
}"
`)
})
Expand Down Expand Up @@ -533,20 +533,20 @@ describe("", () => {
})

expect(printResolver(r1)).toMatchInlineSnapshot(`
"type Query {
"type Dog {
name: String!
birthday: String!
age: Float!
}
type Query {
dog: Dog
cat: Cat!
dogs: [Dog]!
mustDog: Dog!
mustDogs: [Dog!]!
}
type Dog {
name: String!
birthday: String!
age: Float!
}
type Cat {
name: String!
birthday: String!
Expand Down Expand Up @@ -582,12 +582,7 @@ describe("", () => {
})

expect(printResolver(r)).toMatchInlineSnapshot(`
"type Query {
orange: Orange!
apple: Apple!
}
type Orange {
"type Orange {
name: String!
color: String!
prize: Prize!
Expand All @@ -598,6 +593,11 @@ describe("", () => {
value: Float!
}
type Query {
orange: Orange!
apple: Apple!
}
type Apple {
name: String!
color: String!
Expand Down Expand Up @@ -642,12 +642,7 @@ describe("", () => {
})

expect(printResolver(r)).toMatchInlineSnapshot(`
"type Query {
orange: Orange!
apple: Apple!
}
type Orange implements Fruit {
"type Orange implements Fruit {
name: String!
color: String!
prize: Prize!
Expand All @@ -664,6 +659,11 @@ describe("", () => {
value: Float!
}
type Query {
orange: Orange!
apple: Apple!
}
type Apple implements Fruit {
name: String!
color: String!
Expand Down Expand Up @@ -717,19 +717,19 @@ describe("", () => {
})

expect(printResolver(r1)).toMatchInlineSnapshot(`
"type Query {
"type Dog {
name: String!
birthday: String!
age: Float!
}
type Query {
unwrap(name: String!, birthday: String!): Dog!
dog(data: DogInput!): Dog!
dogs(data: [DogInput!]!, required: [DogInput!]!, names: [String!]!): [Dog!]!
mustDog(data: DataInput!): Dog!
}
type Dog {
name: String!
birthday: String!
age: Float!
}
input DogInput {
name: String!
birthday: String!
Expand Down
Loading

0 comments on commit 5d9213d

Please sign in to comment.