Skip to content

Commit

Permalink
Merge pull request #1 from Iteam1337/feat/ci
Browse files Browse the repository at this point in the history
chore: workflow
  • Loading branch information
Alexander Czigler authored Oct 20, 2022
2 parents ec7f263 + b1fd043 commit 8f2fe83
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 13 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Docker CI

on:
push:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3

- name: 🔐 Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: 🔧 Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: iteam1337/mail-signature
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3

- name: 🔧 Test
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: |
npm ci
npx playwright install
npm run check
npm run lint
npm run test
npm run build
docker build -t test .
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ A simple page for generating a mail signature that employees can use with Google

## TODO

- [x] Style the signature
- [x] Deploy to a .services site
- [x] Select address depending on selected office
- [x] Display the non-selected office in the "psst" text
- [ ] Make the signature easier to copy
- [ ] Figure out how to get rid of the extra line above the signature when pasting
- [ ] Google integration for auto-filling the details
- [x] Style the signature
- [x] Deploy to a .services site
- [x] Select address depending on selected office
- [x] Display the non-selected office in the "psst" text
- [ ] Make the signature easier to copy
- [ ] Figure out how to get rid of the extra line above the signature when pasting
- [ ] Google integration for auto-filling the details

## Contributing

Expand Down
11 changes: 6 additions & 5 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
Email: <input type="text" bind:value={email} />@iteam.se<br />
Name: <input type="text" bind:value={name} /><br />
Office:
<select bind:value={office} on:change={selectOffice}>
<option selected>Göteborg</option>
<option>Stockholm</option>
<select bind:value={office} on:change={selectOffice} aria-label="office">
<option value="Göteborg" aria-selected="true">Göteborg</option>
<option value="Stockholm" aria-selected="false">Stockholm</option>
</select><br />
Phone: <input type="text" bind:value={phone} /><br />
Title: <input type="text" bind:value={title} /><br />
Expand Down Expand Up @@ -59,7 +59,7 @@
alt="Iteam"
/>
</td>
<td valign="top" style="padding: 0.01px 0.01px 0.01px 5px; vertical-align:top;">
<td style="padding: 0.01px 0.01px 0.01px 5px; vertical-align:top;">
<table cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
<tbody
><tr>
Expand Down Expand Up @@ -127,6 +127,7 @@
<span
data-acs="title"
style=" text-transform: initial; color: #000000; letter-spacing: 0px; line-height: 0.9; font-size: 11px;"
id="other-office-memo"
>
Psst, du vet väl att vi finns i {otherOffice} också?
</span>
Expand All @@ -138,7 +139,7 @@
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border="0" style="max-width: 600px; width:100%;">
<table cellpadding="0" cellspacing="0" style="max-width: 600px; width:100%;">
<tbody><tr><td style="line-height:00.8" /></tr></tbody>
</table>
</td></tr
Expand Down
21 changes: 20 additions & 1 deletion tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,24 @@ import { expect, test } from '@playwright/test';

test('index page has expected h1', async ({ page }) => {
await page.goto('/');
expect(await page.textContent('h1')).toBe('Welcome to SvelteKit');
expect(await page.textContent('h1')).toBe('Mail Signature');
});

test('index page has expected h2', async ({ page }) => {
await page.goto('/');
expect(await page.textContent('h2')).toBe('1. Enter your details');
});

test('office', async ({ page }) => {
await page.goto('/');

await page.selectOption('[aria-label="office"]', 'Göteborg');
expect(await page.textContent('#other-office-memo')).toContain(
'Psst, du vet väl att vi finns i Stockholm också?'
);

await page.selectOption('[aria-label="office"]', 'Stockholm');
expect(await page.textContent('#other-office-memo')).toContain(
'Psst, du vet väl att vi finns i Göteborg också?'
);
});

0 comments on commit 8f2fe83

Please sign in to comment.