Skip to content

Commit

Permalink
Bump sass from 1.56.1 to 1.57.1 (#214)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/pre-commit/mirrors-eslint: v8.29.0 →
v8.30.0](pre-commit/mirrors-eslint@v8.29.0...v8.30.0)
<!--pre-commit.ci end-->

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: fabasoad <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and fabasoad authored Dec 22, 2022
1 parent b1039f2 commit f8fd82a
Show file tree
Hide file tree
Showing 27 changed files with 479 additions and 1,022 deletions.
40 changes: 15 additions & 25 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ on:
- 'v*.*.*'

jobs:
create_release:
name: Release
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node_modules
id: yarn-cache
uses: actions/cache@v3
Expand All @@ -34,38 +32,30 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
- name: Get latest release tag
id: latest_release
run: |
latest_tag=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "tag=${latest_tag}" >> $GITHUB_OUTPUT
shell: sh
- name: Get current release tag
id: current_release
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
shell: bash
- name: Build changelog
create-release:
name: Create release
needs: [deploy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changelog
id: changelog
run: |
body=$(git log --pretty=oneline ${{ steps.latest_release.outputs.tag }}..${{ steps.current_release.outputs.tag }})
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "body=${body}" >> $GITHUB_OUTPUT
shell: bash
uses: simbo/changes-since-last-release-action@v1
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
name: ${{ steps.current_release.outputs.tag }}
name: ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
body: |
# Changelog
${{ steps.changelog.outputs.body }}
${{ steps.changelog.outputs.log }}
draft: false
prerelease: false
trigger_deployment:
trigger-deployment:
name: Trigger deployment to AWS
if: ${{ false }}
needs: create_release
Expand Down
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ repos:
language: system
pass_filenames: false
verbose: true
- id: eslint
name: Lint
entry: yarn run lint
language: system
pass_filenames: false
verbose: true
stages: ["push"]
- id: test
name: Unit tests
entry: yarn test
Expand All @@ -37,15 +44,6 @@ repos:
hooks:
- id: snyk-test
stages: ["push"]
# TypeScript
- repo: https:/pre-commit/mirrors-eslint
rev: v8.29.0
hooks:
- id: eslint
args: ['--fix']
files: \.[jt]sx?$
types: [file]
exclude: ^dist/.*\.js$
# Markdown
- repo: https:/igorshubovych/markdownlint-cli
rev: v0.32.2
Expand All @@ -71,4 +69,5 @@ repos:
- id: trailing-whitespace
ci:
autofix_prs: true
autoupdate_schedule: quarterly
skip: [build, eslint, test]
4 changes: 2 additions & 2 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"global": {
"branches": 80,
"functions": 60,
"lines": 80,
"statements": 80
"lines": 70,
"statements": 70
}
},
"moduleFileExtensions": ["ts", "tsx", "js"],
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"license": "ISC",
"devDependencies": {
"@babel/cli": "7.19.3",
"@babel/core": "7.20.5",
"@babel/cli": "7.20.7",
"@babel/core": "7.20.7",
"@babel/preset-env": "7.20.2",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
Expand All @@ -39,18 +39,18 @@
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"@types/react-redux": "7.1.24",
"@typescript-eslint/eslint-plugin": "5.45.0",
"@typescript-eslint/parser": "5.45.0",
"@typescript-eslint/eslint-plugin": "5.47.0",
"@typescript-eslint/parser": "5.47.0",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
"babel-jest": "29.3.1",
"babel-loader": "9.1.0",
"babel-plugin-transform-class-properties": "6.24.1",
"bootstrap": "5.2.3",
"css-loader": "6.7.2",
"css-loader": "6.7.3",
"dotenv": "16.0.3",
"enzyme": "3.11.0",
"enzyme-to-json": "3.6.2",
"eslint": "8.29.0",
"eslint": "8.30.0",
"eslint-config-google": "0.14.0",
"eslint-plugin-react": "7.31.11",
"express": "4.18.2",
Expand All @@ -73,15 +73,15 @@
"redux": "4.2.0",
"redux-mock-store": "1.5.4",
"redux-thunk": "2.4.2",
"sass": "1.56.1",
"sass": "1.57.1",
"sass-loader": "13.2.0",
"style-loader": "3.3.1",
"ts-jest": "27.1.5",
"ts-loader": "9.4.2",
"ts-node": "10.9.1",
"typescript": "4.9.4",
"webpack": "5.75.0",
"webpack-cli": "5.0.0",
"webpack-cli": "5.0.1",
"webpack-dev-server": "4.11.1",
"webpack-merge": "5.8.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const mockStore = configureMockStore()
const store = mockStore({})

test('should render CertificateItem correctly', () => {
const month = 2
const monthIndex = 1
const year = 2022
const issueDate = new Date(year, month - 1, 22)
const issueDate = new Date(year, monthIndex, 22)
const issuer: CertificateIssuer = {
name: 'certificate-name',
img: 'certificate-img'
Expand Down Expand Up @@ -49,5 +49,5 @@ test('should render CertificateItem correctly', () => {

elements = container.getElementsByClassName('card-footer')
expect(elements).toHaveLength(1)
expect(elements[0]).toHaveTextContent(`business-card-month-${month} ${year}`)
expect(elements[0]).toHaveTextContent(`business-card-month-${monthIndex} ${year}`)
})
10 changes: 5 additions & 5 deletions src/__tests__/components/Certificates/CertificatesMain.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ test('should render CertificatesMain correctly', () => {
expect(aCardLinkElements.item(4)).toHaveAttribute('href', 'https://www.coursera.org/account/accomplishments/verify/MWE43H8YDS')
const divCardFooterElements = container.querySelectorAll('div.card-footer')
expect(divCardFooterElements).toHaveLength(5)
expect(divCardFooterElements.item(0)).toHaveTextContent('business-card-month-9 2020')
expect(divCardFooterElements.item(1)).toHaveTextContent('business-card-month-5 2020')
expect(divCardFooterElements.item(2)).toHaveTextContent('business-card-month-10 2019')
expect(divCardFooterElements.item(3)).toHaveTextContent('business-card-month-3 2018')
expect(divCardFooterElements.item(4)).toHaveTextContent('business-card-month-5 2015')
expect(divCardFooterElements.item(0)).toHaveTextContent('business-card-month-8 2020')
expect(divCardFooterElements.item(1)).toHaveTextContent('business-card-month-4 2020')
expect(divCardFooterElements.item(2)).toHaveTextContent('business-card-month-9 2019')
expect(divCardFooterElements.item(3)).toHaveTextContent('business-card-month-2 2018')
expect(divCardFooterElements.item(4)).toHaveTextContent('business-card-month-4 2015')
})
20 changes: 0 additions & 20 deletions src/__tests__/components/Experience/ExperienceMain.spec.tsx

This file was deleted.

53 changes: 25 additions & 28 deletions src/__tests__/components/Experience/JobDuration.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,54 @@ import { render } from '@testing-library/react'
import JobDuration from '../../../components/Experience/JobDuration'
import SupportedLocales from '../../../scripts/SupportedLocales'
import { Provider } from 'react-redux'
import DateUtils from '../../../scripts/DateUtils';

const mockStore = configureMockStore()

const fixtures = [{
code: 'gb',
duration: '3 years 8 months'
}, {
code: 'jp',
duration: '3 年 8 ヶ月'
}, {
code: 'ua',
duration: '3 роки 8 місяців'
}]

for (const { code, duration } of fixtures) {
for (const code of ['gb', 'jp', 'ua']) {
test(`[${code}] should render JobDuration correctly with from and to`, () => {
const store = mockStore({
locale: SupportedLocales.getOrDefault(code)
})
const {container} = render(
const fromMonthIndex = 7
const fromYear = 2018
const toMonthIndex = 3
const toYear = 2022
const { container } = render(
<Provider store={store}>
<JobDuration
fromMonth={7}
fromYear={2018}
toMonth={3}
toYear={2022}
fromMonthIndex={fromMonthIndex}
fromYear={fromYear}
toMonthIndex={toMonthIndex}
toYear={toYear}
/>
</Provider>
)
expect(container.querySelector('div.job-duration'))
.toHaveTextContent(duration)
expect(container.querySelector('div.job-duration')).toHaveTextContent(
DateUtils.humanize(
new Date(fromYear, fromMonthIndex),
new Date(toYear, toMonthIndex),
code
)
)
})

test(`[${code}] should render JobDuration correctly with from only`, () => {
const store = mockStore({
locale: SupportedLocales.getOrDefault(code)
})
const now = new Date()
const fromMonth = now.getMonth() > 7
? now.getMonth() - 8
: now.getMonth() + 4
const fromYear = now.getFullYear() - 3
const {container} = render(
const fromMonthIndex = 5
const fromYear = 2017
const { container } = render(
<Provider store={store}>
<JobDuration
fromMonth={fromMonth}
fromMonthIndex={fromMonthIndex}
fromYear={fromYear}
/>
</Provider>
)
expect(container.querySelector('div.job-duration'))
.toHaveTextContent(duration)
expect(container.querySelector('div.job-duration')).toHaveTextContent(
DateUtils.humanize(new Date(fromYear, fromMonthIndex), new Date(), code)
)
})
}
41 changes: 23 additions & 18 deletions src/__tests__/components/Experience/JobPeriod.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,50 @@ import { render, screen } from '@testing-library/react'
import JobPeriod from '../../../components/Experience/JobPeriod'
import { Provider } from 'react-redux'
import SupportedLocales from '../../../scripts/SupportedLocales'
import DateUtils from '../../../scripts/DateUtils';

const mockStore = configureMockStore()

const fixtures = [{
code: 'gb',
duration: '1 year 3 months',
from: 'business-card-month-1 2019',
to: 'business-card-month-4 2020'
}, {
code: 'jp',
duration: '1 年 3 ヶ月',
from: '2019business-card-year-singularbusiness-card-month-1',
to: '2020business-card-year-singularbusiness-card-month-4'
}, {
code: 'ua',
duration: '1 рік 3 місяці',
from: 'business-card-month-1 2019',
to: 'business-card-month-4 2020'
}]

for (const { code, duration, from, to } of fixtures) {
for (const { code, from, to } of fixtures) {
test(`[${code}] should render JobPeriod correctly with from and to`, () => {
const store = mockStore({
locale: SupportedLocales.getOrDefault(code)
})
const fromMonthIndex = 1
const fromYear = 2019
const toMonthIndex = 4
const toYear = 2020
const { container } = render(
<Provider store={store}>
<JobPeriod
fromMonth={1}
fromYear={2019}
toMonth={4}
toYear={2020}
fromMonthIndex={fromMonthIndex}
fromYear={fromYear}
toMonthIndex={toMonthIndex}
toYear={toYear}
/>
</Provider>
)
expect(container.querySelector('div.job-duration'))
.toHaveTextContent(duration)
expect(container.querySelector('div.job-duration')).toHaveTextContent(
DateUtils.humanize(
new Date(fromYear, fromMonthIndex),
new Date(toYear, toMonthIndex),
code
)
)
expect(screen.getByRole('heading', { level: 4 }))
.toHaveTextContent(`${to}-${from}`)
})
Expand All @@ -51,21 +58,19 @@ for (const { code, duration, from, to } of fixtures) {
const store = mockStore({
locale: SupportedLocales.getOrDefault(code)
})
const now = new Date()
const fromMonth = now.getMonth() > 2
? now.getMonth() - 3
: now.getMonth() + 9
const fromYear = now.getFullYear() - 1
const fromMonthIndex = 3
const fromYear = 2016
const { container } = render(
<Provider store={store}>
<JobPeriod
fromMonth={fromMonth}
fromMonthIndex={fromMonthIndex}
fromYear={fromYear}
/>
</Provider>
)
expect(container.querySelector('div.job-duration'))
.toHaveTextContent(duration)
expect(container.querySelector('div.job-duration')).toHaveTextContent(
DateUtils.humanize(new Date(fromYear, fromMonthIndex), new Date(), code)
)
expect(screen.queryByRole('heading', { level: 4 })).not.toBeNull()
})
}
Loading

0 comments on commit f8fd82a

Please sign in to comment.