Skip to content

Commit

Permalink
Merge pull request #337 from DTS-STN/dev
Browse files Browse the repository at this point in the history
Update main from dev (late July)
  • Loading branch information
krischarbonneau authored Jul 26, 2023
2 parents 42da4b2 + 5fa1406 commit d8952fd
Show file tree
Hide file tree
Showing 6 changed files with 4,057 additions and 2,785 deletions.
25 changes: 17 additions & 8 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Secure Client Hub.
# Service Canada Client Hub

Secure Client Hub for Service Canada users accessing benefit details in a unified and consistent experience.
Service Canada Client Hub for Service Canada users accessing benefit details in a unified and consistent experience.

This application is not released yet.

Expand All @@ -13,15 +13,24 @@ This project uses
- [Jest](https://jestjs.io/) for unit testing ![Jest Version (dev dependancy)](https://img.shields.io/github/package-json/dependency-version/DTS-STN/secure-client-hub/dev/jest)
- [Cypress](https://www.cypress.io/) for end-to-end testing. ![Cypress Version (dev dependancy)](https://img.shields.io/github/package-json/dependency-version/DTS-STN/secure-client-hub/dev/cypress)

## Click to view the test reports for DEV 👩‍🔬 🧪

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DTS-STN/secure-client-hub/default-tests.yml?event=push&label=E2E%20tests)](https://dts-stn.github.io/secure-client-hub/dev/e2e-test-report/)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DTS-STN/secure-client-hub/default-tests.yml?event=push&label=Unit%20tests)](https://dts-stn.github.io/secure-client-hub/dev/unit-test-results/lcov-report/)

[![Default Testing](https://github.com/DTS-STN/secure-client-hub/actions/workflows/default-tests.yml/badge.svg?branch=dev)](https://github.com/DTS-STN/secure-client-hub/actions/workflows/default-tests.yml)

## Test reports for Main 👩‍🔬 🧪

[![end-to-end Workflow Status](https://img.shields.io/github/workflow/status/DTS-STN/next-template/E2E%20Test?label=E2E)](https://dts-stn.github.io/secure-client-hub/refs/heads/main/e2e-test-report/)
[![Jest Workflow Status](https://img.shields.io/github/workflow/status/DTS-STN/next-template/Lint%20and%20Test?label=Jest)](https://dts-stn.github.io/secure-client-hub/refs/heads/main/unit-test-results/lcov-report/)
[![Default Testing](https://github.com/DTS-STN/secure-client-hub/actions/workflows/default-tests.yml/badge.svg?branch=main)](https://github.com/DTS-STN/secure-client-hub/actions/workflows/default-tests.yml)

[![end-to-end Workflow Status](https://img.shields.io/github/actions/workflow/status/DTS-STN/secure-client-hub/default-tests.yml?branch=main&label=E2E)](https://dts-stn.github.io/secure-client-hub/main/e2e-test-report/)
[![Jest Workflow Status](https://img.shields.io/github/actions/workflow/status/DTS-STN/secure-client-hub/default-tests.yml?event=push&branch=main&label=Jest)](https://dts-stn.github.io/secure-client-hub/main/unit-test-results/lcov-report/)

![Line Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Line%20Coverage&query=%24.total.lines.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Statements Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Statement%20Coverage&query=%24.total.statements.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Function Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Function%20Coverage&query=%24.total.functions.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Branch Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Branch%20Coverage&query=%24.total.branches.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Frefs%2Fheads%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Line Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Line%20Coverage&query=%24.total.lines.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Statements Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Statement%20Coverage&query=%24.total.statements.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Function Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Function%20Coverage&query=%24.total.functions.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Fmain%2Funit-test-results%2Fcoverage-summary.json)
![Branch Coverage Badge](https://img.shields.io/badge/dynamic/json?label=Branch%20Coverage&query=%24.total.branches.pct&suffix=%25&url=https%3A%2F%2Fdts-stn.github.io%2Fsecure-client-hub%2Fmain%2Funit-test-results%2Fcoverage-summary.json)

## Getting Started

Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/default-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Default Testing
on:
pull_request:
branches: [dev, main, release*]
push:
branches: [dev, main]

jobs:
lint:
Expand Down Expand Up @@ -143,7 +145,7 @@ jobs:
runs-on: ubuntu-latest
#dependabot doesn't get write access
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
Expand All @@ -152,7 +154,17 @@ jobs:
CI: true

- name: Deploy Report 🚀
if: github.event_name == 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
target-folder: ${{ github.ref }}
target-folder: ${{ github.ref }} #source branch
folder: test_results

- name: Deploy Report if push 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
target-folder: ${{ github.ref_name }}/ #target branch of the PR run will be the folder name used for gh-pages
branch: gh-pages
folder: test_results
clean: false
1 change: 0 additions & 1 deletion components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export default function Layout(props) {
></PhaseBanner>
)}
<Header
// analyticsTracking
dataTestId="topnav"
id="header"
linkPath={props.langToggleLink}
Expand Down
13 changes: 11 additions & 2 deletions components/MultiModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types'
import Modal from 'react-modal'
import { useState, useCallback, useEffect } from 'react'
import { useState, useCallback, useEffect, useRef } from 'react'
import ExitBeta from './ExitBeta'
import { useIdleTimer } from 'react-idle-timer'
import CountDown from './sessionModals/CountDown'
Expand All @@ -20,15 +20,23 @@ export default function MultiModal(props) {
} = props

const [timer, setTimer] = useState({ seconds: 0, minutes: 0 })
const clicker = useRef(null)
let modalBody, contentLabel

const handleOnIdle = () => {
Router.push('/auth/logout')
}

const click = () => {
clicker.current.click()
}

const { reset, getRemainingTime } = useIdleTimer({
onIdle: handleOnIdle,
onPrompt: () => openModal('', 'countDown'),
onPrompt: () => {
click()
openModal('', 'countDown')
},
promptBeforeIdle: props.promptBeforeIdle ?? 5 * 60 * 1000, // 5 minutes
timeout: props.timeout ?? 15 * 60 * 1000, // 15 minutes
})
Expand Down Expand Up @@ -107,6 +115,7 @@ export default function MultiModal(props) {

return (
<>
<div ref={clicker} />
<Modal
className="flex justify-center bg-black/75 h-full"
isOpen={openModalWithLink.context != null}
Expand Down
Loading

0 comments on commit d8952fd

Please sign in to comment.