Skip to content

Commit

Permalink
Merge branch 'main' into scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx authored Nov 18, 2024
2 parents 95e583b + 95d4be5 commit c990e7e
Show file tree
Hide file tree
Showing 292 changed files with 2,440 additions and 513 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/analysis-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].4
2 changes: 1 addition & 1 deletion .github/workflows/analysis-tfsec-to-github-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ jobs:
with:
sarif_file: tfsec.sarif
- name: Upload SARIF file
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].4
with:
sarif_file: tfsec.sarif
2 changes: 1 addition & 1 deletion .github/workflows/docker_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:

- name: Upload Trivy scan results to GitHub Security tab for ${{ matrix.ecr_repository }}
id: trivy_upload_sarif
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].4
if: always()
with:
sarif_file: 'trivy-results.sarif'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
--broker-password ${{ secrets.pact_broker_password }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.6.0
uses: codecov/codecov-action@v5.0.0
with:
flags: unittests
files: ./coverage.out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slack_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
Expand Down
3 changes: 2 additions & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
disable-version-string: true
with-expecter: true
inpackage: True
inpackage: true
dir: "{{.InterfaceDir}}"
mockname: "mock{{.InterfaceName|firstUpper}}"
outpkg: "{{.PackageName}}"
Expand Down
21 changes: 14 additions & 7 deletions cmd/enumerator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ import (
"os"
"sort"
"strings"
"unicode"
"unicode/utf8"

"golang.org/x/tools/go/packages"
)
Expand Down Expand Up @@ -602,7 +604,7 @@ func (g *Generator) createIndexAndNameDecl(run []Value, typeName string, suffix

func (g *Generator) buildTextMethods(typeName string) {
if !g.bits {
g.Printf(textMethods, typeName)
g.Printf(textMethods, typeName, upperFirst(typeName))
}
}

Expand All @@ -612,7 +614,7 @@ func (i %[1]s) MarshalText() ([]byte, error) {
}
func (i *%[1]s) UnmarshalText(text []byte) error {
val, err := Parse%[1]s(string(text))
val, err := Parse%[2]s(string(text))
if err != nil {
return err
}
Expand Down Expand Up @@ -654,12 +656,12 @@ func (g *Generator) buildParseMethod(runs [][]Value, typeName string) {
g.Printf("\n")

if g.bits {
g.Printf(`func Parse%[1]s(strs []string) (%[1]s, error) {
var result %[1]s
g.Printf(`func Parse%[1]s(strs []string) (%[2]s, error) {
var result %[2]s
for _, s := range strs {
switch s {
`, typeName)
`, upperFirst(typeName), typeName)
for _, values := range runs {
for _, value := range values {
g.Printf(` case "%[1]s":
Expand All @@ -676,9 +678,9 @@ func (g *Generator) buildParseMethod(runs [][]Value, typeName string) {
}
`, typeName)
} else {
g.Printf(`func Parse%[1]s(s string) (%[1]s, error) {
g.Printf(`func Parse%[1]s(s string) (%[2]s, error) {
switch s {
`, typeName)
`, upperFirst(typeName), typeName)
if g.empty {
g.Printf(` case "":
return %[1]s(0), nil
Expand Down Expand Up @@ -863,3 +865,8 @@ func (g *Generator) buildStrings(runs [][]Value, typeName string) {
}
`)
}

func upperFirst(s string) string {
r, n := utf8.DecodeRuneInString(s)
return string(unicode.ToUpper(r)) + s[n:]
}
2 changes: 1 addition & 1 deletion cmd/event-received/mock_DocumentStore_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_EventClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_Handler_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_LambdaClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_LpaStoreClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_SecretsClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_ShareCodeSender_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_UidClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_UidStore_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_dynamodbClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_factory_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/event-received/mock_s3Client_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 28 additions & 9 deletions cypress/e2e/certificate-provider/confirm-your-identity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ describe('confirm your identity', () => {
beforeEach(() => {
cy.visit('/fixtures/certificate-provider?redirect=/task-list&progress=confirmYourDetails');

cy.url().should('contain', '/task-list');
cy.checkA11yApp();

cy.contains('li', 'Confirm your identity').should('contain', 'Not started').click();

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();

cy.contains('a', 'Continue').click()
cy.contains('li', "Confirm your identity")
.should('contain', 'Not started')
.find('a')
.click();
})

it('can see details of a successful ID check', () => {
cy.contains('button', 'Continue').click()
cy.get('[name="user"]').check('certificate-provider', { force: true })

cy.contains('button', 'Continue').click()
Expand All @@ -40,6 +36,7 @@ describe('confirm your identity', () => {
})

it('can see next steps when failing an ID check', () => {
cy.contains('button', 'Continue').click()
cy.get('[name="return-code"]').check('T', { force: true })

cy.contains('button', 'Continue').click()
Expand All @@ -61,6 +58,7 @@ describe('confirm your identity', () => {
})

it('can see next steps when has insufficient evidence for ID', () => {
cy.contains('button', 'Continue').click()
cy.get('[name="return-code"]').check('X', { force: true })

cy.contains('button', 'Continue').click()
Expand All @@ -80,4 +78,25 @@ describe('confirm your identity', () => {

cy.url().should('contain', '/read-the-lpa');
})

it('can go to the post office ', () => {
cy.url().should('contain', '/confirm-your-identity');
cy.contains('button', 'Continue').click();

cy.go(-2);
cy.contains('li', "Confirm your identity")
.should('contain', 'In progress')
.find('a')
.click();

cy.url().should('contain', '/how-will-you-confirm-your-identity');
cy.checkA11yApp();
cy.contains('label', 'I will confirm my identity at a Post Office').click();
cy.contains('button', 'Continue').click();

cy.contains('li', "Confirm your identity")
.should('contain', 'Pending')
.find('a')
.click();
});
})
46 changes: 39 additions & 7 deletions cypress/e2e/donor/confirm-your-identity.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Sam Smith (donor)').click();
cy.contains('button', 'Continue').click();
Expand All @@ -38,7 +38,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Unable to prove identity (X)').click();
cy.contains('button', 'Continue').click();
Expand All @@ -62,7 +62,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Failed identity check (T)').click();
cy.contains('button', 'Continue').click();
Expand All @@ -89,7 +89,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Failed identity check (T)').click();
cy.contains('button', 'Continue').click();
Expand All @@ -115,7 +115,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Charlie Cooper (certificate provider)').click();
cy.contains('button', 'Continue').click();
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Charlie Cooper (certificate provider)').click();
cy.contains('button', 'Continue').click();
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('Confirm your identity', () => {

cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();
cy.contains('a', 'Continue').click();
cy.contains('button', 'Continue').click();

cy.contains('label', 'Charlie Cooper (certificate provider)').click();
cy.contains('button', 'Continue').click();
Expand All @@ -193,4 +193,36 @@ describe('Confirm your identity', () => {
cy.contains('.govuk-error-message', 'Select yes if you would like to update your details');
});
});

describe('when going to the post office', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa');
});

it('can be completed ', () => {
cy.contains('li', "Confirm your identity")
.should('contain', 'Not started')
.find('a')
.click();

cy.url().should('contain', '/confirm-your-identity');
cy.contains('button', 'Continue').click();

cy.go(-2);
cy.contains('li', "Confirm your identity")
.should('contain', 'In progress')
.find('a')
.click();

cy.url().should('contain', '/how-will-you-confirm-your-identity');
cy.checkA11yApp();
cy.contains('label', 'I will confirm my identity at a Post Office').click();
cy.contains('button', 'Continue').click();

cy.contains('li', "Confirm your identity")
.should('contain', 'Pending')
.find('a')
.click();
});
});
});
Loading

0 comments on commit c990e7e

Please sign in to comment.