(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestMigrateToV7(t *testing.T) { |
| 325 | // set up |
| 326 | ctx := setupEnv(t, "../tmp") |
| 327 | defer teardownEnv(t, ctx) |
| 328 | |
| 329 | testutils.CopyFixture(t, ctx, "./fixtures/legacy-7-pre-actions.json", "actions") |
| 330 | |
| 331 | // execute |
| 332 | if err := migrateToV7(ctx); err != nil { |
| 333 | t.Fatal(errors.Wrap(err, "migrating").Error()) |
| 334 | } |
| 335 | |
| 336 | // test |
| 337 | b := testutils.ReadFile(ctx, "actions") |
| 338 | var got []migrateToV7Action |
| 339 | if err := json.Unmarshal(b, &got); err != nil { |
| 340 | t.Fatal(errors.Wrap(err, "unmarshalling the result").Error()) |
| 341 | } |
| 342 | |
| 343 | b2 := utils.ReadFileAbs("./fixtures/legacy-7-post-actions.json") |
| 344 | var expected []migrateToV7Action |
| 345 | if err := json.Unmarshal(b, &expected); err != nil { |
| 346 | t.Fatal(errors.Wrap(err, "unmarshalling the result into Dnote").Error()) |
| 347 | } |
| 348 | |
| 349 | assert.EqualJSON(t, string(b), string(b2), "Result does not match") |
| 350 | } |
| 351 | |
| 352 | func TestMigrateToV8(t *testing.T) { |
| 353 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected