6 "github.com/mjl-/mox/imapclient"
9func TestUnselect(t *testing.T) {
13 tc.client.Login("mjl@mox.example", password0)
14 tc.client.Select("inbox")
16 tc.transactf("bad", "unselect bogus") // Leftover data.
17 tc.transactf("ok", "unselect")
18 tc.transactf("no", "fetch 1 all") // Invalid when not selected.
20 tc.client.Select("inbox")
21 tc.client.Append("inbox", nil, nil, []byte(exampleMsg))
22 tc.client.StoreFlagsAdd("1", true, `\Deleted`)
23 tc.transactf("ok", "unselect")
24 tc.transactf("ok", "status inbox (messages)")
25 tc.xuntagged(imapclient.UntaggedStatus{Mailbox: "Inbox", Attrs: map[imapclient.StatusAttr]int64{imapclient.StatusMessages: 1}}) // Message not removed.