Browse Source

Simple tests work now.

master
Zed A. Shaw 4 months ago
parent
commit
2016db2ac1
  1. 2
      client/components/Footer.svelte
  2. 4
      client/pages/Home.svelte
  3. 4
      client/pages/Login.svelte
  4. 2
      client/routes.js
  5. 8
      emails/config.js
  6. 2
      stats.html
  7. 18
      tests/ui/chat.js
  8. 6
      tests/ui/login.js

2
client/components/Footer.svelte

@ -14,7 +14,7 @@
<aside>
<h3>Code</h3>
<p>You can look at the code in the <a href="https://git.learnjsthehardway.com/zedshaw/zedshaw.games">Learn JS the Hard Way Git Repository.</a> This is <b>not</b> open source software and you have no license to run it.</p>
<p>You can look at the code in the <a href="https://git.learnjsthehardway.com/zedshaw/ljsthw-project-template">Learn JS the Hard Way Git Repository.</a> This is <b>not</b> open source software and you have no license to run it.</p>
</aside>
</section>
</footer>

4
client/pages/Home.svelte

@ -0,0 +1,4 @@
<content data-testid="home-page">
<h1>Home Page</h1>
</content>

4
client/pages/Login.svelte

@ -4,7 +4,7 @@
import { push } from 'svelte-spa-router';
$: if($user.authenticated) {
push("/watch/");
push("/home/");
}
</script>
@ -24,5 +24,5 @@
</style>
<main>
<Login on:authenticated={ () => push('/watch/') } />
<Login on:authenticated={ () => push('/home/') } />
</main>

2
client/routes.js

@ -6,6 +6,7 @@ import AdminTable from './pages/admin/Table.svelte';
import AdminReadUpdate from './pages/admin/ReadUpdate.svelte';
import UserProfile from './pages/UserProfile.svelte';
import ResetPassword from './pages/ResetPassword.svelte';
import Home from './pages/Home.svelte';
import NotFound from './pages/NotFound.svelte';
import Components from './bando/Components.svelte';
@ -14,6 +15,7 @@ export default {
'/login/': Login,
'/forgot/': ResetPassword,
'/profile/': UserProfile,
'/home/': Home,
'/admin/table/create/:table/': AdminCreate,
'/admin/table/:table/': AdminTable,
'/admin/table/:table/:row_id/': AdminReadUpdate,

8
emails/config.js

@ -1,14 +1,14 @@
export const company = {
owner: 'Zed A. Shaw',
product: 'ZedShaw.Games',
owner: 'Your Name',
product: 'Your Product',
copyright_date: '2021',
name: 'Shavian Publishing, LLC',
name: 'Your Company, LLC',
street: '1234 Weird Street Address',
zip_code: '33333',
city: 'Big City',
state: 'BC',
country: 'USA',
phone: '1-800-NO-WAY',
mail: 'payments@zedshaw.games',
mail: 'payments@yoursite.com',
website: 'localhost:5001'
}

2
stats.html

File diff suppressed because one or more lines are too long

18
tests/ui/chat.js

@ -1,18 +0,0 @@
import test from 'ava';
import {sleep, expect, wait, tid, playstart} from '../../lib/testing.js';
test.before(async t => {
t.context = await playstart('http://localhost:5001/client/#/watch/')
});
test.after(async t => await t.context.browser.close());
test('confirm chatting without logging in works', async (t) => {
const { browser, context, p} = t.context;
try {
await expect(t, p, tid('chat-panel'));
} catch (error) {
console.error(error)
}
});

6
tests/ui/login.js

@ -31,10 +31,10 @@ test('standalone login page works', async (t) => {
await p.fill("#password", "testing");
await p.click(tid('login-button'));
await sleep(500);
await wait(p, tid('livestream-page'));
await wait(p, tid('home-page'));
// confirm livestream page and logout-link are visible
await expect(t, p, tid('livestream-page'));
// confirm home page and logout-link are visible
await expect(t, p, tid('home-page'));
await expect(t, p, tid('logout-link'));
// logout and see login to chat

Loading…
Cancel
Save