SOURCE / PINNED RELEASE
Made of little things.
Faultline
- Release
- da1ffaa5624c…
- Author-recorded commit
- 60f5f03189db…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6932b12c78c
Archive hash verified: 5a2e0492417ec4e7…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
// Exercise actual host controls plus a deterministic public-profile fixture for account transitions.
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const { chromium } = createRequire(require.resolve('@napplet/conformance-cli/package.json'))(
'playwright',
);
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1280, height: 820 } });
const errors = [];
page.on('pageerror', (e) => errors.push(e.message));
await page.goto(process.argv[2]);
const holder = page.locator('iframe').first();
await holder.waitFor();
let frame = await (await holder.elementHandle()).contentFrame();
const click = (name) => frame.getByRole('button', { name, exact: true }).click();
await click('Settings');
await frame.getByLabel('Custom name').fill('Spruce');
await click('Done');
await page.reload();
await holder.waitFor();
frame = await (await holder.elementHandle()).contentFrame();
await click('Settings');
await frame.waitForFunction(() => document.querySelector('#alias-name').value === 'Spruce');
await frame.getByLabel('Play as').selectOption('nostr');
await frame.waitForFunction(() =>
/Sign in|Using|unavailable|public key/.test(document.querySelector('#profile-status').textContent),
);
console.log('soyLI identity:', await frame.locator('#profile-status').innerText());
await frame.getByLabel('Play as').selectOption('alias');
await click('Done');
await click('Previous battlefield');
await click('Solo practice');
await page.keyboard.press('c');
await frame.waitForFunction(() => document.querySelector('#scene').dataset.crouch === 'true');
await page.keyboard.down('q');
await frame.waitForFunction(() => +document.querySelector('#scene').dataset.lean < -60);
await page.keyboard.up('q');
await click('Open match menu');
await click('Player settings');
await frame.getByLabel('Crouch behavior').selectOption('hold');
await click('Done');
await click('Resume');
await page.keyboard.down('c');
await frame.waitForFunction(() => document.querySelector('#scene').dataset.crouch === 'true');
await page.keyboard.up('c');
await frame.waitForFunction(() => document.querySelector('#scene').dataset.crouch === 'false');
assert.deepEqual(errors, []);
await page.close();
const fixture = await browser.newPage();
await fixture.addInitScript(() => {
const state = { reads: 0, change: () => {}, get: async () => ({ displayName: 'Fir Scout' }) };
window.profileFixture = state;
window.napplet = {
storage: {
getItem: async key => localStorage.getItem(key),
setItem: async (key, value) => localStorage.setItem(key, value),
},
identity: {
getPublicKey: async () => 'a'.repeat(64),
getProfile: () => {
state.reads++;
return state.get();
},
onChanged: (f) => {
state.change = f;
return { close() {} };
},
},
};
});
await fixture.route('http://localhost/fixture', (r) =>
r.fulfill({
path: new URL('../dist/index.html', import.meta.url).pathname,
contentType: 'text/html',
}),
);
await fixture.goto('http://localhost/fixture');
await fixture.getByRole('button', { name: 'Settings', exact: true }).click();
assert.equal(await fixture.evaluate(() => window.profileFixture.reads), 0);
await fixture.getByLabel('Play as').selectOption('nostr');
await fixture.getByText('Using Fir Scout.').waitFor();
assert.ok(await fixture.getByLabel('Custom name').isHidden());
await fixture.getByRole('button', { name: 'Done', exact: true }).click();
await fixture.reload();
await fixture.getByRole('button', { name: 'Settings', exact: true }).click();
await fixture.getByText('Using Fir Scout.').waitFor();
await fixture.evaluate(() => {
localStorage.clear();
window.profileFixture.change('');
});
assert.equal(await fixture.getByLabel('Play as').inputValue(), 'alias');
await fixture.evaluate(() => {
window.profileFixture.get = () => new Promise((resolve) => (window.profileFixture.finish = resolve));
});
await fixture.getByLabel('Play as').selectOption('nostr');
await fixture.waitForFunction(() => typeof window.profileFixture.finish === 'function');
await fixture.getByLabel('Play as').selectOption('alias');
await fixture.evaluate(() => window.profileFixture.finish({ displayName: 'Late profile' }));
assert.equal(await fixture.getByLabel('Play as').inputValue(), 'alias');
console.log(
'Passed settings persistence, toggle and hold crouch, lean, signed-in profile, account change and stale lookup.',
);
} finally {
await browser.close();
}
