Skip to content

Commit

Permalink
Migrate tests from Jest references to Vitest references
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Jan 19, 2023
1 parent e3c5837 commit c45edda
Show file tree
Hide file tree
Showing 31 changed files with 501 additions and 481 deletions.
148 changes: 80 additions & 68 deletions packages/toolkit/src/entities/tests/sorted_state_adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,16 @@ describe('Sorted State Adapter', () => {
adapter.removeAll(draft)
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {},
"ids": Array [],
{
"entities": {
"tgg": {
"id": "tgg",
"title": "The Great Gatsby",
},
},
"ids": [
"tgg",
],
}
`)
})
Expand All @@ -604,14 +611,19 @@ describe('Sorted State Adapter', () => {
})

expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"tgg": Object {
{
"entities": {
"af": {
"id": "af",
"title": "Animal Farm",
},
"tgg": {
"id": "tgg",
"title": "The Great Gatsby",
},
},
"ids": Array [
"ids": [
"af",
"tgg",
],
}
Expand All @@ -624,18 +636,18 @@ describe('Sorted State Adapter', () => {
})

expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"af": Object {
{
"entities": {
"af": {
"id": "af",
"title": "Animal Farm",
},
"tgg": Object {
"tgg": {
"id": "tgg",
"title": "The Great Gatsby",
},
},
"ids": Array [
"ids": [
"af",
"tgg",
],
Expand Down Expand Up @@ -679,14 +691,14 @@ describe('Sorted State Adapter', () => {
})

expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"tgg": Object {
{
"entities": {
"tgg": {
"id": "tgg",
"title": "A New Hope",
},
},
"ids": Array [
"ids": [
"tgg",
],
}
Expand Down Expand Up @@ -714,23 +726,23 @@ describe('Sorted State Adapter', () => {
})

expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"aco": Object {
{
"entities": {
"aco": {
"id": "aco",
"title": "Third Change",
},
"tgg": Object {
"tgg": {
"id": "tgg",
"title": "Second Change",
},
"th": Object {
"th": {
"author": "Fourth Change",
"id": "th",
"title": "First Change",
},
},
"ids": Array [
"ids": [
"th",
"tgg",
"aco",
Expand All @@ -744,14 +756,14 @@ describe('Sorted State Adapter', () => {
adapter.upsertOne(draft, TheGreatGatsby)
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"tgg": Object {
{
"entities": {
"tgg": {
"id": "tgg",
"title": "The Great Gatsby",
"title": "A New Hope",
},
},
"ids": Array [
"ids": [
"tgg",
],
}
Expand All @@ -767,15 +779,20 @@ describe('Sorted State Adapter', () => {
})
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"tgg": Object {
{
"entities": {
"af": {
"id": "af",
"title": "Animal Farm",
},
"tgg": {
"id": "tgg",
"title": "A New Hope",
},
},
"ids": Array [
"ids": [
"tgg",
"af",
],
}
`)
Expand All @@ -793,20 +810,15 @@ describe('Sorted State Adapter', () => {
])
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"af": Object {
"id": "af",
"title": "Animal Farm",
},
"tgg": Object {
{
"entities": {
"tgg": {
"id": "tgg",
"title": "A New Hope",
"title": "The Great Gatsby",
},
},
"ids": Array [
"ids": [
"tgg",
"af",
],
}
`)
Expand All @@ -817,15 +829,15 @@ describe('Sorted State Adapter', () => {
adapter.setOne(draft, TheGreatGatsby)
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"tgg": Object {
"id": "tgg",
"title": "The Great Gatsby",
{
"entities": {
"th": {
"id": "th",
"title": "Silmarillion",
},
},
"ids": Array [
"tgg",
"ids": [
"th",
],
}
`)
Expand All @@ -840,14 +852,19 @@ describe('Sorted State Adapter', () => {
})
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"th": Object {
{
"entities": {
"af": {
"id": "af",
"title": "Animal Farm",
},
"th": {
"id": "th",
"title": "Silmarillion",
},
},
"ids": Array [
"ids": [
"af",
"th",
],
}
Expand All @@ -866,20 +883,15 @@ describe('Sorted State Adapter', () => {
])
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"af": Object {
{
"entities": {
"af": {
"id": "af",
"title": "Animal Farm",
},
"th": Object {
"id": "th",
"title": "Silmarillion",
},
},
"ids": Array [
"ids": [
"af",
"th",
],
}
`)
Expand All @@ -891,15 +903,15 @@ describe('Sorted State Adapter', () => {
adapter.removeOne(draft, TheGreatGatsby.id)
})
expect(result).toMatchInlineSnapshot(`
Object {
"entities": Object {
"af": Object {
"id": "af",
"title": "Animal Farm",
{
"entities": {
"aco": {
"id": "aco",
"title": "A Clockwork Orange",
},
},
"ids": Array [
"af",
"ids": [
"aco",
],
}
`)
Expand Down
Loading

0 comments on commit c45edda

Please sign in to comment.