github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/engine/paperkey_primary_test.go (about)

     1  // Copyright 2015 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  package engine
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/keybase/client/go/libkb"
    10  )
    11  
    12  func TestPaperKeyPrimary(t *testing.T) {
    13  	tc := SetupEngineTest(t, "paper")
    14  	defer tc.Cleanup()
    15  
    16  	f := func(arg *SignupEngineRunArg) {
    17  		arg.SkipPaper = true
    18  	}
    19  
    20  	fu, signingKey, encryptionKey := CreateAndSignupFakeUserCustomArg(tc, "paper", f)
    21  
    22  	me, err := libkb.LoadMe(libkb.NewLoadUserArg(tc.G))
    23  	if err != nil {
    24  		t.Fatal(err)
    25  	}
    26  
    27  	uis := libkb.UIs{
    28  		LoginUI: &libkb.TestLoginUI{},
    29  	}
    30  	args := &PaperKeyPrimaryArgs{
    31  		Me:            me,
    32  		SigningKey:    signingKey,
    33  		EncryptionKey: encryptionKey,
    34  	}
    35  	eng := NewPaperKeyPrimary(tc.G, args)
    36  	m := NewMetaContextForTest(tc).WithUIs(uis)
    37  	if err := RunEngine2(m, eng); err != nil {
    38  		t.Fatal(err)
    39  	}
    40  
    41  	hasOnePaperDev(tc, fu)
    42  }