Skip to content

Commit

Permalink
Merge pull request #221 from uselagoon/cypress-only
Browse files Browse the repository at this point in the history
Cypress support in the UI
  • Loading branch information
tobybellwood authored Feb 29, 2024
2 parents 8cff175 + 16db318 commit c1e0a8a
Show file tree
Hide file tree
Showing 267 changed files with 6,856 additions and 2,168 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module.exports = {
extends: ['next', 'plugin:storybook/recommended'],
rules: {
'import/no-anonymous-default-export': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unescaped-entities': 0,
'react/display-name': 'off',
},
ignorePatterns: ['src/**/*.stories.js'],
ignorePatterns: ['src/**/*.stories.js', 'src/**/*.stories.tsx', 'src/tours'],

overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
public
*.min.*
*.yaml
*.yml
3 changes: 2 additions & 1 deletion .storybook/decorators/withLoadingSkeletons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from 'react';

import ThemedSkeletonWrapper from '../../src/styles/ThemedSkeletonWrapper';
import { darkTheme, lightTheme } from '../../src/styles/theme';

const withLoadingSkeletons = (Story, context) => {
const initialTheme = (context.globals.theme === '' || context.globals.theme ==="dark") ? 'dark' : "light";
const initialTheme = context.globals.theme === '' || context.globals.theme === 'dark' ? 'dark' : 'light';
const {
//@ts-ignore
skeleton: { base, highlight },
Expand Down
2 changes: 1 addition & 1 deletion .storybook/decorators/withMockedAppContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const withMockedAppContext = initialTheme => (Story, context) => {

useEffect(() => {
if (!isDocsPage) {
const initialTheme = (context.globals.theme === '' || context.globals.theme ==="dark") ? 'dark' : "light";
const initialTheme = context.globals.theme === '' || context.globals.theme === 'dark' ? 'dark' : 'light';
const newBg = initialTheme === 'dark' ? '#333333' : '#F8F8F8';

setGlobals({
Expand Down
3 changes: 1 addition & 2 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<link rel="shortcut icon" href="/favicon.ico">
<link rel="icon" type="image/png" href="/logo.svg" sizes="192x192">
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="icon" type="image/png" href="/logo.svg" sizes="192x192" />
4 changes: 2 additions & 2 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LagoonTheme from './lagoonTheme';

addons.setConfig({
theme: LagoonTheme,
sidebar:{
sidebar: {
showRoots: false,
}
},
});
4 changes: 2 additions & 2 deletions .storybook/mocks/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ProblemIdentifier,
generateEnvironments,
organizationEmails,
organizationEnvironments,
organizationGroups,
organizationNotifications,
organizationOwners,
organizationProjects,
organizationEnvironments
} from './mocks';

faker.setDefaultRefDate(new Date(`${new Date().getFullYear().toString()}-01-01`));
Expand Down Expand Up @@ -126,7 +126,7 @@ export const MockBulkDeployments = (seed: number) => {
name: faker.lorem.slug({ min: 1, max: 5 }),
created: faker.date.past().toDateString(),
started: faker.date.past().toDateString(),
buildStep:faker.word.words(),
buildStep: faker.word.words(),
completed: faker.date.past().toDateString(),
buildLog: faker.word.words(),
bulkId: faker.string.uuid(),
Expand Down
11 changes: 8 additions & 3 deletions .storybook/mocks/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Tasks {
created: string;
service: string;
status: string;
id: string;
}[];
environmentSlug: string;
projectSlug: string;
Expand All @@ -27,8 +28,9 @@ interface Task {
status: string;
files: TaskFile[];
logs: string;
taskName?: string;
taskName: string;
name?: string;
id: string;
};
}
faker.setDefaultRefDate(new Date(`${new Date().getFullYear().toString()}-01-01`));
Expand All @@ -45,6 +47,7 @@ export function createTasks(): Tasks {
created: faker.date.anytime().toDateString(),
service: 'cli',
status: faker.helpers.arrayElement(['Pending', 'In progress', 'Completed']),
id: faker.string.uuid(),
};
});

Expand All @@ -66,7 +69,8 @@ export function createTask(): Task {
`::group::${eventName}\n` +
`::${status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]}:: Job '${jobName}'\n` +
`::step-start::${stepName}\n` +
`::${status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]
`::${
status[Math.floor(faker.number.int({ min: 0, max: 1 }) * status.length)]
}:: Job '${jobName}' step '${stepName}'\n` +
`::step-end::${stepName}::${duration}\n` +
`${generateLogMessage()}\n` +
Expand All @@ -88,6 +92,7 @@ export function createTask(): Task {
files,
logs: log,
taskName: faker.lorem.slug(2),
id: faker.string.uuid(),
},
};
}
Expand Down Expand Up @@ -311,7 +316,7 @@ export const getDeployment = (seed: number) => {
status: deployStatus(),
created,
started,
buildStep:faker.word.words(3),
buildStep: faker.word.words(3),
completed,
environment: generateEnvironments({ seed }),
remoteId: faker.number.int(),
Expand Down
Loading

0 comments on commit c1e0a8a

Please sign in to comment.