Skip to content

Commit 91fe448

Browse files
committed
UI test for change password
Help docs
1 parent cfbd7f0 commit 91fe448

File tree

7 files changed

+61
-17
lines changed

7 files changed

+61
-17
lines changed

backend/embed/migrations/20201013035839_initial_data.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ INSERT INTO `certificate_authority` (
8787
0,
8888
5,
8989
1
90+
), (
91+
strftime('%s', 'now'),
92+
strftime('%s', 'now'),
93+
"SSL.com",
94+
"ssl.com",
95+
0,
96+
10,
97+
1
9098
), (
9199
strftime('%s', 'now'),
92100
strftime('%s', 'now'),
@@ -103,14 +111,6 @@ INSERT INTO `certificate_authority` (
103111
0,
104112
5,
105113
1
106-
), (
107-
strftime('%s', 'now'),
108-
strftime('%s', 'now'),
109-
"SSL.com",
110-
"ssl.com",
111-
0,
112-
10,
113-
1
114114
);
115115

116116
-- System User

frontend/src/components/Navigation/NavigationHeader.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function NavigationHeader({
7070
<Box pl={2}>
7171
<Menu>
7272
<MenuButton
73+
data-testid="profile-menu"
7374
as={Button}
7475
rounded="full"
7576
variant="link"
@@ -84,6 +85,7 @@ function NavigationHeader({
8485
{intl.formatMessage({ id: "profile.title" })}
8586
</MenuItem>
8687
<MenuItem
88+
data-testid="profile-menu-change-password"
8789
icon={<Icon as={FiLock} />}
8890
onClick={passwordDisclosure.onOpen}>
8991
{intl.formatMessage({ id: "change-password" })}

frontend/src/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,6 @@ pre {
7272
margin: 0;
7373
font-size: var(--chakra-fontSizes-lg);
7474
font-weight: var(--chakra-fontWeights-semibold);
75+
color: var(--chakra-colors-teal-500)
7576
}
7677
}

frontend/src/locale/src/HelpDoc/en/Certificates.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@
22

33
## HTTP Certificate
44

5-
todo
5+
A HTTP validated certificate means that the Certificate Authority (CA) will
6+
attempt to reach your domains over HTTP (not HTTPS!) and if successful, the CA
7+
will issue your certificate.
8+
9+
For this method, you will have to have a _Host_ created for your domains(s) that
10+
is accessible with HTTP. After a certificate has been given, you can modify the
11+
_Host_ to also use this certificate for HTTPS connections. However, the _Host_
12+
will still need to be configured for HTTP access in order for the certificate to
13+
renew.
614

715
## DNS Certificate
816

9-
todo
17+
A DNS validated certificate requires you to create a DNS Provider. This DNS
18+
Provider will be used to create temporary records on your ___domain and then the CA
19+
will query those records to be sure you're the owner and if successful, the CA
20+
will issue your certificate.
21+
22+
You do not need a _Host_ to be created prior to requesting this type of
23+
certificate. Nor do you need to have your _Host_ configured for HTTP access.
1024

1125
## Custom Certificate
1226

@@ -15,3 +29,7 @@ todo
1529
## MKCert Certificate
1630

1731
todo
32+
33+
## Choosing a Certificate Authority
34+
35+
If you're not sure, use **ZeroSSL.**
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# DNS Providers Help
22

3-
todo
3+
A DNS Provider is a service that hosts your ___domain(s) and this will be
4+
specifically used when requesting new _Certificates_ via DNS Validation.
5+
6+
It is preferred to use DNS Validation, so check if your ___domain is hosted with
7+
one of the supported Acme.sh providers:
8+
9+
- [DNS Page 1](https://github.com/acmesh-official/acme.sh/wiki/dnsapi)
10+
- [DNS Page 2](https://github.com/acmesh-official/acme.sh/wiki/dnsapi2)
11+
12+
Should your DNS Provider be supported by Acme.sh and not available in this
13+
project, please
14+
[open an issue on Github](https://github.com/NginxProxyManager/nginx-proxy-manager/issues/new/choose).

frontend/src/modals/ChangePasswordModal.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function ChangePasswordModal({ isOpen, onClose }: ChangePasswordModalProps) {
7676
return errors;
7777
}}>
7878
{({ isSubmitting, values }: any) => (
79-
<Form>
79+
<Form data-testid="change-password">
8080
<ModalHeader>
8181
{intl.formatMessage({ id: "change-password" })}
8282
</ModalHeader>
@@ -156,10 +156,16 @@ function ChangePasswordModal({ isOpen, onClose }: ChangePasswordModalProps) {
156156
</Stack>
157157
</ModalBody>
158158
<ModalFooter>
159-
<PrettyButton mr={3} isLoading={isSubmitting}>
159+
<PrettyButton
160+
mr={3}
161+
isLoading={isSubmitting}
162+
data-testid="save">
160163
{intl.formatMessage({ id: "form.save" })}
161164
</PrettyButton>
162-
<Button onClick={onClose} isLoading={isSubmitting}>
165+
<Button
166+
onClick={onClose}
167+
isLoading={isSubmitting}
168+
data-testid="cancel">
163169
{intl.formatMessage({ id: "form.cancel" })}
164170
</Button>
165171
</ModalFooter>

test/cypress/integration/ui/SetupLogin.spec.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ describe('UI Setup and Login', () => {
2222
cy.clearLocalStorage();
2323
});
2424

25-
it('Should be able to login', function() {
25+
it('Should be able to login and change password', function() {
2626
cy.visit('/');
2727
cy.get('input[name="email"]').type('[email protected]');
2828
cy.get('input[name="password"]').type('changeme');
2929
cy.get('form button:last').click();
3030

31-
// To fix after chakra change:
32-
// cy.get('.navbar-nav .avatar').should('be.visible');
31+
// change password
32+
cy.get('button[data-testid="profile-menu"]').should('be.visible').click();
33+
cy.get('button[data-testid="profile-menu-change-password"]').should('be.visible').click();
34+
cy.get('input[name="current"]').type('changeme');
35+
cy.get('input[name="password"]').type('ihavebeenchanged');
36+
cy.get('input[name="password2"]').type('ihavebeenchanged');
37+
cy.get('form button[data-testid="save"]').click();
38+
cy.get('form[data-testid="change-password"]').should('not.exist');
3339

3440
// logout:
3541
cy.clearLocalStorage();

0 commit comments

Comments
 (0)