Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Website Pages #568

Merged
merged 6 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
"cypress"
],
"rules": {
"function-call-argument-newline": ["off"],
"function-paren-newline": ["off"],
"import/prefer-default-export": ["off"],
"max-len": ["error", { "code": 120 }],
"newline-per-chained-call": ["off"],
"no-console": ["off"],
"no-nested-ternary": ["off"],
"no-promise-executor-return": ["off"],
"no-underscore-dangle": ["off"],
"semi": ["error", "always"],
"react/jsx-filename-extension": ["off"],
"react/function-component-definition": ["off"],
"react/jsx-props-no-spreading": ["off"],
"react/no-danger": ["off"],
"@next/next/no-html-link-for-pages": ["off"],
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
timeout-minutes: 7
timeout-minutes: 10

strategy:
matrix:
Expand Down Expand Up @@ -40,5 +40,5 @@ jobs:
run: yarn test:build
- name: Test API
run: yarn jest
# - name: Test API Homepage
# run: yarn cypress:ci
- name: Test API Homepage
run: yarn cypress:ci
6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ jobs:
- name: Install Node.js dependencies
run: yarn install

- name: Run linters
uses: wearerequired/lint-action@v1
with:
eslint: true
- name: Run ESLint
run: yarn run eslint ./src --ext .js,.jsx,.ts,.tsx -c ./.eslintrc.json
10 changes: 10 additions & 0 deletions __tests__/cypress/integration/client.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ describe('Igbo API Homepage', () => {
cy.contains('Email:');
});

it('render the Privacy page', () => {
cy.findByText('Privacy').click();
cy.findByText('Privacy Policy').should('exist');
});

it('render the Terms or Service page', () => {
cy.findByText('Terms of Service').click();
cy.findByText('Terms and Conditions').should('exist');
});

describe('Try it Out', () => {
it('enter a word and select flag', () => {
cy.visit('/');
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
displayName: 'igbo-api-admin',
testMatch: ['**/__tests__/*.js'],
testTimeout: 15000,
testTimeout: 20000,
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js', 'json'],
globalSetup: './testSetup.js',
Expand Down
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@
"babel-loader": "^8.1.0",
"cross-env": "^7.0.2",
"cypress": "^6.0.0",
"eslint": "^7.10.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-next": "^12.0.7",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.21.3",
"eslint": "8.34.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-next": "13.1.6",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-react": "7.32.2",
"husky": "^4.3.0",
"jest": "^29.2.2",
"lint-staged": "^10.4.0",
Expand All @@ -167,6 +167,9 @@
"tag": true
}
},
"resolutions": {
"esquery": "1.4.0"
},
"nodemonConfig": {
"delay": "1500ms"
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { appWithTranslation } from 'next-i18next';
import Head from 'next/head';
import ChakraTheme from '../shared/constants/ChakraTheme';
import en from '../public/locales/en';
import ig from '../public/locales/ig';
import * as gtag from '../lib/gtag';
Expand Down Expand Up @@ -49,7 +50,7 @@ const MainApp = ({ Component, pageProps, ...rest }) => {
<title>Igbo API - The First African Language API</title>
</Head>
<>
<ChakraProvider>
<ChakraProvider theme={ChakraTheme}>
<Component {...pageProps} {...rest} />
</ChakraProvider>
{/* Global Site Tag (gtag.js) - Google Analytics */}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const About = () => {
<a className="link" href={DICTIONARY_APP_URL}>
Nkọwa okwu
</a>
{' , our official online Igbo-English dictionary app.'}
, our official online Igbo-English dictionary app.
</p>
) : (
<p dangerouslySetInnerHTML={{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/Footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Footer = () => {
</li>
<li>
<a href="/terms" className="font-normal border-b border-b-gray-500">
Terms of service
Terms of Service
</a>
</li>
<li>
Expand Down