(t *testing.T)
| 294 | } |
| 295 | |
| 296 | func TestMigrateToV6(t *testing.T) { |
| 297 | // set up |
| 298 | ctx := setupEnv(t, "../tmp") |
| 299 | defer teardownEnv(t, ctx) |
| 300 | |
| 301 | testutils.CopyFixture(t, ctx, "./fixtures/legacy-6-pre-dnote.json", "dnote") |
| 302 | |
| 303 | // execute |
| 304 | if err := migrateToV6(ctx); err != nil { |
| 305 | t.Fatal(errors.Wrap(err, "Failed to migrate").Error()) |
| 306 | } |
| 307 | |
| 308 | // test |
| 309 | b := testutils.ReadFile(ctx, "dnote") |
| 310 | var got migrateToV6PostDnote |
| 311 | if err := json.Unmarshal(b, &got); err != nil { |
| 312 | t.Fatal(errors.Wrap(err, "Failed to unmarshal the result into Dnote").Error()) |
| 313 | } |
| 314 | |
| 315 | b = utils.ReadFileAbs("./fixtures/legacy-6-post-dnote.json") |
| 316 | var expected migrateToV6PostDnote |
| 317 | if err := json.Unmarshal(b, &expected); err != nil { |
| 318 | t.Fatal(errors.Wrap(err, "Failed to unmarshal the result into Dnote").Error()) |
| 319 | } |
| 320 | |
| 321 | assert.DeepEqual(t, expected, got, "payload mismatch") |
| 322 | } |
| 323 | |
| 324 | func TestMigrateToV7(t *testing.T) { |
| 325 | // set up |
nothing calls this directly
no test coverage detected