Skip to content

Commit

Permalink
Build out additional integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Dec 15, 2024
1 parent 3d576ae commit 20842a1
Showing 1 changed file with 86 additions and 4 deletions.
90 changes: 86 additions & 4 deletions tests/integration/forge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,93 @@ describe('sites', () => {
expect(output3).toMatch(/sqlite \.+ \[\] OK/);
});

test.todo('add aliases');
test('add aliases', async () => {
let name = `test-${id()}.laravel-deploy-preview.com`;
let alias = `test-alias-${id()}.laravel-deploy-preview.com`;

let site = await Forge.createSite(server, {
name,
database: '',
aliases: [alias],
});

expect(site).toMatchObject({
server_id: server,
name: name,
aliases: [alias],
status: 'installing',
});

await until(
() => site.status === 'installed',
async () => (site = await Forge.getSite(server, site.id)),
);

expect(site).toMatchObject({
server_id: server,
name: name,
aliases: [alias],
status: 'installed',
});
});

test('enable isolation', async () => {
let name = `test-${id()}.laravel-deploy-preview.com`;
let username = `test-user-${id()}`;

let site = await Forge.createSite(server, {
name,
database: '',
isolated: true,
username,
});

expect(site).toMatchObject({
server_id: server,
name: name,
username,
status: 'installing',
});

await until(
() => site.status === 'installed',
async () => (site = await Forge.getSite(server, site.id)),
);

test.todo('enable isolation');
expect(site).toMatchObject({
server_id: server,
name: name,
username,
status: 'installed',
});
});

test.todo('set isolation username');
test('set php version', async () => {
let name = `test-${id()}.laravel-deploy-preview.com`;

let site = await Forge.createSite(server, {
name,
database: '',
php: 'php83',
});

test.todo('set php version');
expect(site).toMatchObject({
server_id: server,
name: name,
php_version: 'php83',
status: 'installing',
});

await until(
() => site.status === 'installed',
async () => (site = await Forge.getSite(server, site.id)),
);

expect(site).toMatchObject({
server_id: server,
name: name,
php_version: 'php83',
status: 'installed',
});
});
});

0 comments on commit 20842a1

Please sign in to comment.