• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 1568834739

02 Dec 2024 10:01AM UTC coverage: 73.562% (+0.8%) from 72.786%
1568834739

Pull #211

gitlab-ci

mineralsfree
test: added upgrade unit tests

Ticket: MEN-7469
Changelog: None

Signed-off-by: Mikita Pilinka <mikita.pilinka@northern.tech>
Pull Request #211: MEN-7469-feat: updated upgrades and add-on page

4251 of 6156 branches covered (69.05%)

Branch coverage included in aggregate %.

166 of 200 new or added lines in 18 files covered. (83.0%)

47 existing lines in 4 files now uncovered.

40029 of 54038 relevant lines covered (74.08%)

17.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/frontend/src/js/common-ui/dialogs/ConfirmUpgrade.tsx
1
// Copyright 2024 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14
import { Button, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';
15

16
import { ADDONS, Plan } from '@northern.tech/store/constants';
17

18
interface ConfirmUpgradeProps {
19
  onConfirm: () => void;
20
  onClose: () => void;
21
  newPlan: Plan;
22
  currentPlan: Plan;
23
  addOns: { name: string }[];
24
}
25
export const ConfirmUpgrade = (props: ConfirmUpgradeProps) => {
6✔
26
  const { onConfirm, onClose, newPlan, currentPlan, addOns } = props;
1✔
27
  return (
1✔
28
    <Dialog open={!!newPlan}>
29
      <DialogTitle>Upgrade your plan to {newPlan.name}</DialogTitle>
30
      <DialogContent>
31
        <div className="margin-bottom-small">
32
          You are currently subscribed to the <b>Mender {currentPlan.name}</b> plan.
33
        </div>
34
        <div className="margin-bottom-small">
35
          Confirm to upgrade to <b>Mender {newPlan.name}</b>, billed at {newPlan.price}. <br />
36
          {addOns.map(addon => {
NEW
37
            return (
×
38
              <div key={addon.name}>
39
                The price of your <b>Mender {addon.name}</b> add-on package will change to {ADDONS[addon.name][newPlan.id].price}
40
              </div>
41
            );
42
          })}
43
        </div>
44
        <div>
45
          See full details of features and pricing at{' '}
46
          <a href="https://mender.io/plans/pricing" target="_blank" rel="noreferrer">
47
            mender.io/plans/pricing.
48
          </a>
49
        </div>
50
      </DialogContent>
51
      <DialogActions>
52
        <Button onClick={onClose}>Cancel</Button>
53
        <Button color="secondary" variant="contained" onClick={onConfirm}>
54
          Confirm
55
        </Button>
56
      </DialogActions>
57
    </Dialog>
58
  );
59
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc