package main // The columns and icons spec's mutations for the importer's looks // (§6.1, §6.4, §9): an emoji icon written unchecked, an external cover // fetched without asking the pin, a look left out of "unchanged", the // styled revision skipped, an icon's two limits, and a fix-up dropping // the look it did not prepare. const ( importLooksGo = "internal/mapa/import_looks.go" importWriteGo = "internal/mapa/import_write.go" importStoreGo = "internal/mapa/import_store.go" ) var importLookMutations = []mutation{ {gate: "I20", test: "TestI20IconsAreImported", pkg: inside, name: "an emoji icon written without the list's check", edits: []edit{{file: importLooksGo, from: "\t\tmade, err := EmojiIcon(icon.Emoji)", to: "\t\tmade, err := &Icon{Emoji: icon.Emoji}, error(nil)"}}}, {gate: "I21", test: "TestI21CoversAreImportedFromThePinOnly", pkg: inside, name: "an external cover fetched without asking the pin", edits: []edit{{file: importLooksGo, from: "(cover.Type == notion.FileExternal && " + "job.files.Gallery(cover.URL))", to: "cover.Type == notion.FileExternal"}}}, {gate: "I24", test: "TestI24ALookChangedInNotionIsStyled", pkg: inside, name: "unchanged decided without the look", edits: []edit{{file: importWriteGo, from: "\t\tentry.current.Body == cleanBody(body) &&\n" + "\t\tsameLook(entry.current, entry.lookRecord()) {", to: "\t\tentry.current.Body == cleanBody(body) {"}}}, {gate: "I24", test: "TestI24RenamedStyledEditedInOrder", pkg: inside, name: "ImportUpdate writes no styled revision", edits: []edit{{file: importStoreGo, from: "\t\tif err := tx.importStyle(&page, &record, actor, " + "write); err != nil {", to: "\t\tif err := error(nil); err != nil {"}}}, {gate: "I20", test: "TestI20IconsAreImported", pkg: inside, name: "an icon over 512 pixels a side kept", edits: []edit{{file: importLooksGo, from: "if pseudo == iconPlace && added.Side() > MaxIconSide {", to: "if pseudo == iconPlace && added.Side() > 1<<20 {"}}}, {gate: "I20", test: "TestI20IconsAreImported", pkg: inside, name: "an icon fetched with the 10 MB cap", edits: []edit{{file: importLooksGo, from: "\t\treturn page.Icon.URL, MaxIconBytes", to: "\t\treturn page.Icon.URL, imageCap"}}}, {gate: "I24", test: "TestI24AFixUpAfterAResumeKeepsTheIcon", pkg: inside, name: "a fix-up with no prepared look writes none", edits: []edit{{file: importWriteGo, from: "\t\treturn Record{Icon: entry.current.Icon, " + "Banner: entry.current.Banner}", to: "\t\treturn Record{}"}}}, }